|
OpenQuizz
Une application de gestion des contenus pédagogiques
|
Functions | |
| def | make_headers (keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None) |
| def | set_file_position (body, pos) |
| def | rewind_body (body, body_pos) |
Variables | |
| SKIP_HEADER | |
| SKIPPABLE_HEADERS | |
| ACCEPT_ENCODING | |
| def pip._vendor.urllib3.util.request.make_headers | ( | keep_alive = None, |
|
accept_encoding = None, |
|||
user_agent = None, |
|||
basic_auth = None, |
|||
proxy_basic_auth = None, |
|||
disable_cache = None |
|||
| ) |
Shortcuts for generating request headers.
:param keep_alive:
If ``True``, adds 'connection: keep-alive' header.
:param accept_encoding:
Can be a boolean, list, or string.
``True`` translates to 'gzip,deflate'.
List will get joined by comma.
String will be used as provided.
:param user_agent:
String representing the user-agent you want, such as
"python-urllib3/0.6"
:param basic_auth:
Colon-separated username:password string for 'authorization: basic ...'
auth header.
:param proxy_basic_auth:
Colon-separated username:password string for 'proxy-authorization: basic ...'
auth header.
:param disable_cache:
If ``True``, adds 'cache-control: no-cache' header.
Example::
>>> make_headers(keep_alive=True, user_agent="Batman/1.0")
{'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
>>> make_headers(accept_encoding=True)
{'accept-encoding': 'gzip,deflate'}
| def pip._vendor.urllib3.util.request.rewind_body | ( | body, | |
| body_pos | |||
| ) |
Attempt to rewind body to a certain position.
Primarily used for request redirects and retries.
:param body:
File-like object that supports seek.
:param int pos:
Position to seek to in file.
| def pip._vendor.urllib3.util.request.set_file_position | ( | body, | |
| pos | |||
| ) |
If a position is provided, move file to that point. Otherwise, we'll attempt to record a position for future use.
| ACCEPT_ENCODING |
| SKIP_HEADER |
| SKIPPABLE_HEADERS |