class documentation

class HTTPTransport(BaseTransport): (source)

View In Hierarchy

Undocumented

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method close Undocumented
Method handle_request Send a single HTTP request and return a response.
Instance Variable _pool Undocumented
def __enter__(self): (source)

Undocumented

Returns
TUndocumented
def __exit__(self, exc_type=None, exc_value=None, traceback=None): (source)

Undocumented

Parameters
exc_type:typing.Optional[typing.Type[BaseException]]Undocumented
exc_value:typing.Optional[BaseException]Undocumented
traceback:typing.Optional[TracebackType]Undocumented
def __init__(self, verify=True, cert=None, http1=True, http2=False, limits=DEFAULT_LIMITS, trust_env=True, proxy=None, uds=None, local_address=None, retries=0): (source)

Undocumented

Parameters
verify:VerifyTypesUndocumented
cert:typing.Optional[CertTypes]Undocumented
http1:boolUndocumented
http2:boolUndocumented
limits:LimitsUndocumented
trust_env:boolUndocumented
proxy:typing.Optional[Proxy]Undocumented
uds:typing.Optional[str]Undocumented
local_address:typing.Optional[str]Undocumented
retries:intUndocumented
def close(self): (source)

Undocumented

def handle_request(self, request): (source)

Send a single HTTP request and return a response. Developers shouldn't typically ever need to call into this API directly, since the Client class provides all the higher level user-facing API niceties. In order to properly release any network resources, the response stream should *either* be consumed immediately, with a call to `response.stream.read()`, or else the `handle_request` call should be followed with a try/finally block to ensuring the stream is always closed. Example usage: with httpx.HTTPTransport() as transport: req = httpx.Request( method=b"GET", url=(b"https", b"www.example.com", 443, b"/"), headers=[(b"Host", b"www.example.com")], ) resp = transport.handle_request(req) body = resp.stream.read() print(resp.status_code, resp.headers, body) Takes a `Request` instance as the only argument. Returns a `Response` instance.

Parameters
request:RequestUndocumented
Returns
ResponseUndocumented

Undocumented