|
def | get_redirect_target (self, resp) |
|
def | should_strip_auth (self, old_url, new_url) |
|
def | resolve_redirects (self, resp, req, stream=False, timeout=None, verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs) |
|
def | rebuild_auth (self, prepared_request, response) |
|
def | rebuild_proxies (self, prepared_request, proxies) |
|
def | rebuild_method (self, prepared_request, response) |
|
◆ get_redirect_target()
def get_redirect_target |
( |
|
self, |
|
|
|
resp |
|
) |
| |
Receives a Response. Returns a redirect URI or ``None``
◆ rebuild_auth()
def rebuild_auth |
( |
|
self, |
|
|
|
prepared_request, |
|
|
|
response |
|
) |
| |
When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.
◆ rebuild_method()
def rebuild_method |
( |
|
self, |
|
|
|
prepared_request, |
|
|
|
response |
|
) |
| |
When being redirected we may want to change the method of the request
based on certain specs or browser behavior.
◆ rebuild_proxies()
def rebuild_proxies |
( |
|
self, |
|
|
|
prepared_request, |
|
|
|
proxies |
|
) |
| |
This method re-evaluates the proxy configuration by considering the
environment variables. If we are redirected to a URL covered by
NO_PROXY, we strip the proxy configuration. Otherwise, we set missing
proxy keys for this URL (in case they were stripped by a previous
redirect).
This method also replaces the Proxy-Authorization header where
necessary.
:rtype: dict
◆ resolve_redirects()
def resolve_redirects |
( |
|
self, |
|
|
|
resp, |
|
|
|
req, |
|
|
|
stream = False , |
|
|
|
timeout = None , |
|
|
|
verify = True , |
|
|
|
cert = None , |
|
|
|
proxies = None , |
|
|
|
yield_requests = False , |
|
|
** |
adapter_kwargs |
|
) |
| |
Receives a Response. Returns a generator of Responses or Requests.
◆ should_strip_auth()
def should_strip_auth |
( |
|
self, |
|
|
|
old_url, |
|
|
|
new_url |
|
) |
| |
Decide whether Authorization header should be removed when redirecting
The documentation for this class was generated from the following file:
- /home/passerat/Stage/flaskProject/venv/lib/python3.8/site-packages/requests/sessions.py