Orbits
1
|
Public Member Functions | |
def | __init__ |
def | __getstate__ |
def | __setstate__ |
def | init_poolmanager |
def | cert_verify |
def | build_response |
def | get_connection |
def | close |
def | request_url |
def | add_headers |
def | proxy_headers |
def | send |
Public Member Functions inherited from pip._vendor.requests.adapters.BaseAdapter | |
def | __init__ |
def | send |
def | close |
Public Attributes | |
max_retries | |
config | |
proxy_manager | |
poolmanager | |
Private Attributes | |
_pool_connections | |
_pool_maxsize | |
_pool_block | |
Static Private Attributes | |
list | __attrs__ |
The built-in HTTP Adapter for urllib3. Provides a general-case interface for Requests sessions to contact HTTP and HTTPS urls by implementing the Transport Adapter interface. This class will usually be created by the :class:`Session <Session>` class under the covers. :param pool_connections: The number of urllib3 connection pools to cache. :param pool_maxsize: The maximum number of connections to save in the pool. :param int max_retries: The maximum number of retries each connection should attempt. Note, this applies only to failed connections and timeouts, never to requests where the server returns a response. :param pool_block: Whether the connection pool should block for connections. Usage:: >>> import requests >>> s = requests.Session() >>> a = requests.adapters.HTTPAdapter(max_retries=3) >>> s.mount('http://', a)
def pip._vendor.requests.adapters.HTTPAdapter.__init__ | ( | self, | |
pool_connections = DEFAULT_POOLSIZE , |
|||
pool_maxsize = DEFAULT_POOLSIZE , |
|||
max_retries = DEFAULT_RETRIES , |
|||
pool_block = DEFAULT_POOLBLOCK |
|||
) |
def pip._vendor.requests.adapters.HTTPAdapter.__getstate__ | ( | self | ) |
def pip._vendor.requests.adapters.HTTPAdapter.__setstate__ | ( | self, | |
state | |||
) |
def pip._vendor.requests.adapters.HTTPAdapter.add_headers | ( | self, | |
request, | |||
kwargs | |||
) |
Add any headers needed by the connection. As of v2.0 this does nothing by default, but is left for overriding by users that subclass the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param request: The :class:`PreparedRequest <PreparedRequest>` to add headers to. :param kwargs: The keyword arguments from the call to send().
def pip._vendor.requests.adapters.HTTPAdapter.build_response | ( | self, | |
req, | |||
resp | |||
) |
Builds a :class:`Response <requests.Response>` object from a urllib3 response. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>` :param req: The :class:`PreparedRequest <PreparedRequest>` used to generate the response. :param resp: The urllib3 response object.
def pip._vendor.requests.adapters.HTTPAdapter.cert_verify | ( | self, | |
conn, | |||
url, | |||
verify, | |||
cert | |||
) |
Verify a SSL certificate. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param conn: The urllib3 connection object associated with the cert. :param url: The requested URL. :param verify: Whether we should actually verify the certificate. :param cert: The SSL certificate to verify.
def pip._vendor.requests.adapters.HTTPAdapter.close | ( | self | ) |
Disposes of any internal state. Currently, this just closes the PoolManager, which closes pooled connections.
def pip._vendor.requests.adapters.HTTPAdapter.get_connection | ( | self, | |
url, | |||
proxies = None |
|||
) |
Returns a urllib3 connection for the given URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param url: The URL to connect to. :param proxies: (optional) A Requests-style dictionary of proxies used on this request.
def pip._vendor.requests.adapters.HTTPAdapter.init_poolmanager | ( | self, | |
connections, | |||
maxsize, | |||
block = DEFAULT_POOLBLOCK |
|||
) |
Initializes a urllib3 PoolManager. This method should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param connections: The number of urllib3 connection pools to cache. :param maxsize: The maximum number of connections to save in the pool. :param block: Block when no free connections are available.
def pip._vendor.requests.adapters.HTTPAdapter.proxy_headers | ( | self, | |
proxy | |||
) |
Returns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param proxies: The url of the proxy being used for this request. :param kwargs: Optional additional keyword arguments.
def pip._vendor.requests.adapters.HTTPAdapter.request_url | ( | self, | |
request, | |||
proxies | |||
) |
Obtain the url to use when making the final request. If the message is being sent through a HTTP proxy, the full URL has to be used. Otherwise, we should only use the path portion of the URL. This should not be called from user code, and is only exposed for use when subclassing the :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`. :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. :param proxies: A dictionary of schemes to proxy URLs.
def pip._vendor.requests.adapters.HTTPAdapter.send | ( | self, | |
request, | |||
stream = False , |
|||
timeout = None , |
|||
verify = True , |
|||
cert = None , |
|||
proxies = None |
|||
) |
Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest <PreparedRequest>` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) The timeout on the request. :param verify: (optional) Whether to verify SSL certificates. :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request.
|
staticprivate |
|
private |
|
private |
|
private |
pip._vendor.requests.adapters.HTTPAdapter.config |
pip._vendor.requests.adapters.HTTPAdapter.max_retries |
pip._vendor.requests.adapters.HTTPAdapter.poolmanager |
pip._vendor.requests.adapters.HTTPAdapter.proxy_manager |
Copyright 2014 Google Inc. All rights reserved.