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'}
Source code in client/ayon_fusion/vendor/urllib3/util/request.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
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.
Source code in client/ayon_fusion/vendor/urllib3/util/request.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
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.
Source code in client/ayon_fusion/vendor/urllib3/util/request.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|