class HTTPTransport(BaseTransport): (source)
Undocumented
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | close |
Undocumented |
Method | handle |
Send a single HTTP request and return a response. |
Instance Variable | _pool |
Undocumented |
httpx.BaseTransport.__exit__
Undocumented
Parameters | |
exctyping.Optional[ | Undocumented |
exctyping.Optional[ | Undocumented |
traceback:typing.Optional[ | Undocumented |
Undocumented
Parameters | |
verify:VerifyTypes | Undocumented |
cert:typing.Optional[ | Undocumented |
http1:bool | Undocumented |
http2:bool | Undocumented |
limits:Limits | Undocumented |
trustbool | Undocumented |
proxy:typing.Optional[ | Undocumented |
uds:typing.Optional[ | Undocumented |
localtyping.Optional[ | Undocumented |
retries:int | Undocumented |
httpx.BaseTransport.handle_request
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:Request | Undocumented |
Returns | |
Response | Undocumented |