Skip to content

Upgrading httpx 0.10 to 0.11

Breaking0.10.1 → 0.11.1Breaking5New1Changed1Fixed5

BreakingUpgrade verdict

5 breaking changes.

  • Code that read the origin of a URL or used the Origin class must be updated.
  • TLS and environment settings can no longer be passed on individual requests.
  • Streaming responses now use a dedicated streaming API rather than a per-request flag.
  • Simple one-off calls like httpx.get(url) now block and return a response directly instead of returning an async object.
Top 3 of 5 that need code or config changes

Adds urllib3 ==1.*.

Installs 11 packages in all (was 10).

Breaking5
Removes the request.url.origin property and the httpx.Origin class.
request.url.originhttpx.Origin
Per-request cert, verify, and trust_env arguments are no longer available.
certverifytrust_env
The stream argument is no longer available; use client.stream() or httpx.stream() instead.
streamclient.stream()httpx.stream()
Top level API such as httpx.get(), httpx.post(), and httpx.request() becomes synchronous.
httpx.get()httpx.post()httpx.request()
Switches proxy configuration to proxies=httpx.Proxy(...).
httpx.Proxy()proxies

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: export HTTPProxy
  • removed: export HTTPProxyMode
  • removed: export Origin
  • removed: export RedirectBodyUnavailable
  • removed: export TimeoutConfig
  • added: export ASGIDispatch
  • added: export Auth
  • added: export Proxy
  • added: export RequestBodyUnavailable
  • added: export RequestNotRead
  • added: export WSGIDispatch
  • changed: async function delete(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function delete(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function get(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function get(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function head(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function head(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function options(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function options(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function patch(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function patch(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function post(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function post(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function put(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response → function put(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: TimeoutTypes=…, trust_env: bool=…) -> Response
  • changed: async function request(method: str, url: URLTypes, *, params: QueryParamTypes=…, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, timeout: TimeoutTypes=…, allow_redirects: bool=…, verify: VerifyTypes=…, cert: CertTypes=…, stream: bool=…, trust_env: bool=…) -> Response → function request(method: str, url: URLTypes, *, params: QueryParamTypes=…, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, timeout: TimeoutTypes=…, allow_redirects: bool=…, verify: VerifyTypes=…, cert: CertTypes=…, trust_env: bool=…) -> Response
  • removed: variable AuthFlow
  • added: field Auth.requires_request_body
  • added: method Auth.auth_flow(request: Request) -> typing.Generator[Request, Response, None]
  • added: method BasicAuth.auth_flow(request: Request) -> typing.Generator[Request, Response, None]
  • added: method DigestAuth.auth_flow(request: Request) -> typing.Generator[Request, Response, None]
  • added: method FunctionAuth.auth_flow(request: Request) -> typing.Generator[Request, Response, None]
  • removed: async method AsyncioBackend.run_in_threadpool(func: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: method AsyncioBackend.run(coroutine: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: property AsyncioBackend.loop -> asyncio.AbstractEventLoop
  • removed: async method AutoBackend.run_in_threadpool(func: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: async method ConcurrencyBackend.run_in_threadpool(func: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: method ConcurrencyBackend.run(coroutine: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: async method TrioBackend.run_in_threadpool(func: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: method TrioBackend.run(coroutine: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> typing.Any
  • removed: method AsyncClient.build_redirect_request(request: Request, response: Response) -> Request
  • removed: method AsyncClient.build_request(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…) -> Request
  • removed: method AsyncClient.merge_cookies(cookies: CookieTypes=…) -> typing.Optional[CookieTypes]
  • removed: method AsyncClient.merge_headers(headers: HeaderTypes=…) -> typing.Optional[HeaderTypes]
  • removed: method AsyncClient.merge_queryparams(params: QueryParamTypes=…) -> typing.Optional[QueryParamTypes]
  • removed: method AsyncClient.merge_url(url: URLTypes) -> URL
  • removed: method AsyncClient.redirect_headers(request: Request, url: URL, method: str) -> Headers
  • removed: method AsyncClient.redirect_method(request: Request, response: Response) -> str
  • removed: method AsyncClient.redirect_stream(request: Request, method: str) -> typing.Optional[ContentStream]
  • removed: method AsyncClient.redirect_url(request: Request, response: Response) -> URL
  • removed: method AsyncClient.setup_auth(request: Request, auth: AuthTypes=…) -> Auth
  • removed: method AsyncClient.stream(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> StreamContextManager
  • removed: property AsyncClient.cookies -> Cookies
  • removed: property AsyncClient.headers -> Headers
  • removed: property AsyncClient.params -> QueryParams
  • removed: variable Client
  • changed: async method AsyncClient.delete(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.delete(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.get(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.get(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.head(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.head(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.options(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.options(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.patch(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.patch(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.post(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.post(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.put(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.put(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.request(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, cert: CertTypes=…, verify: VerifyTypes=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, trust_env: bool=…) -> Response → async method AsyncClient.request(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • changed: async method AsyncClient.send_handling_auth(request: Request, auth: Auth, timeout: Timeout) -> Response → async method AsyncClient.send_handling_auth(request: Request, history: typing.List[Response], auth: Auth, timeout: Timeout) -> Response
  • changed: class AsyncClient → class AsyncClient(BaseClient)
  • changed: constructor AsyncClient(*, auth: AuthTypes=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, verify: VerifyTypes=…, cert: CertTypes=…, http2: bool=…, proxies: ProxiesTypes=…, timeout: TimeoutTypes=…, pool_limits: PoolLimits=…, max_redirects: int=…, base_url: URLTypes=…, dispatch: Dispatcher=…, app: typing.Callable=…, backend: typing.Union[str, ConcurrencyBackend]=…, tr… → constructor AsyncClient(*, auth: AuthTypes=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, verify: VerifyTypes=…, cert: CertTypes=…, http2: bool=…, proxies: ProxiesTypes=…, timeout: TimeoutTypes=…, pool_limits: PoolLimits=…, max_redirects: int=…, base_url: URLTypes=…, dispatch: AsyncDispatcher=…, app: typing.Callable=…, backend: typing.Union[str, ConcurrencyBackend]=…
  • changed: constructor StreamContextManager(client: AsyncClient, request: Request, *, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, close_client: bool=…) -> None → constructor StreamContextManager(client: BaseClient, request: Request, *, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…, close_client: bool=…) -> None
  • changed: method AsyncClient.dispatcher_for_url(url: URL) -> Dispatcher → method AsyncClient.dispatcher_for_url(url: URL) -> AsyncDispatcher
  • added: class BaseClient
  • added: class Client(BaseClient)
  • added: constructor BaseClient(*, auth: AuthTypes=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, timeout: TimeoutTypes=…, max_redirects: int=…, base_url: URLTypes=…, trust_env: bool=…)
  • added: constructor Client(*, auth: AuthTypes=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, verify: VerifyTypes=…, cert: CertTypes=…, proxies: ProxiesTypes=…, timeout: TimeoutTypes=…, pool_limits: PoolLimits=…, max_redirects: int=…, base_url: URLTypes=…, dispatch: SyncDispatcher=…, app: typing.Callable=…, trust_env: bool=…)
  • added: method AsyncClient.init_dispatch(verify: VerifyTypes=…, cert: CertTypes=…, http2: bool=…, pool_limits: PoolLimits=…, dispatch: AsyncDispatcher=…, app: typing.Callable=…, backend: typing.Union[str, ConcurrencyBackend]=…, trust_env: bool=…, uds: str=…) -> AsyncDispatcher
  • added: method AsyncClient.init_proxy_dispatch(proxy: Proxy, verify: VerifyTypes=…, cert: CertTypes=…, http2: bool=…, pool_limits: PoolLimits=…, backend: typing.Union[str, ConcurrencyBackend]=…, trust_env: bool=…) -> AsyncDispatcher
  • added: method BaseClient.build_auth(request: Request, auth: AuthTypes=…) -> Auth
  • added: method BaseClient.build_redirect_request(request: Request, response: Response) -> Request
  • added: method BaseClient.build_request(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…) -> Request
  • added: method BaseClient.get_proxy_map(proxies: typing.Optional[ProxiesTypes], trust_env: bool) -> typing.Dict[str, Proxy]
  • added: method BaseClient.merge_cookies(cookies: CookieTypes=…) -> typing.Optional[CookieTypes]
  • added: method BaseClient.merge_headers(headers: HeaderTypes=…) -> typing.Optional[HeaderTypes]
  • added: method BaseClient.merge_queryparams(params: QueryParamTypes=…) -> typing.Optional[QueryParamTypes]
  • added: method BaseClient.merge_url(url: URLTypes) -> URL
  • added: method BaseClient.redirect_headers(request: Request, url: URL, method: str) -> Headers
  • added: method BaseClient.redirect_method(request: Request, response: Response) -> str
  • added: method BaseClient.redirect_stream(request: Request, method: str) -> typing.Optional[ContentStream]
  • added: method BaseClient.redirect_url(request: Request, response: Response) -> URL
  • added: method BaseClient.stream(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> StreamContextManager
  • added: method Client.close() -> None
  • added: method Client.delete(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.dispatcher_for_url(url: URL) -> SyncDispatcher
  • added: method Client.get(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.head(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.init_dispatch(verify: VerifyTypes=…, cert: CertTypes=…, pool_limits: PoolLimits=…, dispatch: SyncDispatcher=…, app: typing.Callable=…, trust_env: bool=…) -> SyncDispatcher
  • added: method Client.init_proxy_dispatch(proxy: Proxy, verify: VerifyTypes=…, cert: CertTypes=…, pool_limits: PoolLimits=…, trust_env: bool=…) -> SyncDispatcher
  • added: method Client.options(url: URLTypes, *, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.patch(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.post(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.put(url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.request(method: str, url: URLTypes, *, data: RequestData=…, files: RequestFiles=…, json: typing.Any=…, params: QueryParamTypes=…, headers: HeaderTypes=…, cookies: CookieTypes=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.send(request: Request, *, stream: bool=…, auth: AuthTypes=…, allow_redirects: bool=…, timeout: typing.Union[TimeoutTypes, UnsetType]=…) -> Response
  • added: method Client.send_handling_auth(request: Request, history: typing.List[Response], auth: Auth, timeout: Timeout) -> Response
  • added: method Client.send_handling_redirects(request: Request, auth: Auth, timeout: Timeout, allow_redirects: bool=…, history: typing.List[Response]=…) -> Response
  • added: method Client.send_single_request(request: Request, timeout: Timeout) -> Response
  • added: property BaseClient.cookies -> Cookies
  • added: property BaseClient.headers -> Headers
  • added: property BaseClient.params -> QueryParams
  • removed: variable TimeoutConfig
  • removed: variable USER_AGENT
  • changed: constructor SSLConfig(*, cert: CertTypes=…, verify: VerifyTypes=…, trust_env: bool=…) → constructor SSLConfig(*, cert: CertTypes=…, verify: VerifyTypes=…, trust_env: bool=…, http2: bool=…)
  • changed: method SSLConfig.load_ssl_context(http2: bool=…) -> ssl.SSLContext → method SSLConfig.load_ssl_context() -> ssl.SSLContext
  • changed: method SSLConfig.load_ssl_context_no_verify(http2: bool=…) -> ssl.SSLContext → method SSLConfig.load_ssl_context_no_verify() -> ssl.SSLContext
  • changed: method SSLConfig.load_ssl_context_verify(http2: bool=…) -> ssl.SSLContext → method SSLConfig.load_ssl_context_verify() -> ssl.SSLContext
  • added: class Proxy
  • added: constructor Proxy(url: URLTypes, *, headers: HeaderTypes=…, mode: str=…)
  • added: variable ProxiesTypes
  • added: class IteratorStream(ContentStream)
  • added: constructor IteratorStream(iterator: typing.Iterator[bytes], close_func: typing.Callable=…) -> None
  • added: method ContentStream.close() -> None
  • added: method IteratorStream.can_replay() -> bool
  • added: method IteratorStream.close() -> None
  • added: method IteratorStream.get_headers() -> typing.Dict[str, str]
  • removed: variable ACCEPT_ENCODING
  • removed: export ASGIDispatch
  • changed: class ASGIDispatch(Dispatcher) → class ASGIDispatch(AsyncDispatcher)
  • removed: async method Dispatcher.close() -> None
  • removed: async method Dispatcher.request(method: str, url: URLTypes, *, data: RequestData=…, params: QueryParamTypes=…, headers: HeaderTypes=…, timeout: Timeout=…) -> Response
  • removed: async method Dispatcher.send(request: Request, timeout: Timeout=…) -> Response
  • removed: class Dispatcher
  • added: async method AsyncDispatcher.close() -> None
  • added: async method AsyncDispatcher.request(method: str, url: URLTypes, *, data: RequestData=…, params: QueryParamTypes=…, headers: HeaderTypes=…, timeout: Timeout=…) -> Response
  • added: async method AsyncDispatcher.send(request: Request, timeout: Timeout=…) -> Response
  • added: class AsyncDispatcher
  • added: class SyncDispatcher
  • added: method SyncDispatcher.close() -> None
  • added: method SyncDispatcher.send(request: Request, timeout: Timeout=…) -> Response
  • removed: async method HTTPConnection.get_ssl_context(ssl: SSLConfig) -> typing.Optional[ssl.SSLContext]
  • changed: class HTTPConnection(Dispatcher) → class HTTPConnection(AsyncDispatcher)
  • changed: constructor HTTPConnection(origin: typing.Union[str, Origin], verify: VerifyTypes=…, cert: CertTypes=…, trust_env: bool=…, http2: bool=…, backend: typing.Union[str, ConcurrencyBackend]=…, release_func: typing.Optional[ReleaseCallback]=…, uds: typing.Optional[str]=…) → constructor HTTPConnection(origin: typing.Union[str, Origin], ssl: SSLConfig=…, backend: typing.Union[str, ConcurrencyBackend]=…, release_func: typing.Optional[ReleaseCallback]=…, uds: typing.Optional[str]=…)
  • changed: class ConnectionPool(Dispatcher) → class ConnectionPool(AsyncDispatcher)
  • added: class URLLib3Dispatcher(SyncDispatcher)
  • added: constructor URLLib3Dispatcher(*, proxy: Proxy=…, verify: VerifyTypes=…, cert: CertTypes=…, trust_env: bool=…, pool_limits: PoolLimits=…)
  • added: method URLLib3Dispatcher.close() -> None
  • added: method URLLib3Dispatcher.init_pool_manager(proxy: typing.Optional[Proxy], ssl_context: ssl.SSLContext, num_pools: int, maxsize: int, block: bool) -> typing.Union[urllib3.PoolManager, urllib3.ProxyManager]
  • added: method URLLib3Dispatcher.send(request: Request, timeout: Timeout=…) -> Response
  • added: class WSGIDispatch(SyncDispatcher)
  • added: constructor WSGIDispatch(app: typing.Callable, raise_app_exceptions: bool=…, script_name: str=…, remote_addr: str=…) -> None
  • added: method WSGIDispatch.send(request: Request, timeout: TimeoutTypes=…) -> Response
  • removed: class RedirectBodyUnavailable(RedirectError)
  • changed: class ConnectionClosed(HTTPError) → class ConnectionClosed(NetworkError)
  • added: class NetworkError(HTTPError)
  • added: class RequestBodyUnavailable(StreamError)
  • added: class RequestNotRead(StreamError)
  • removed: property URL.origin -> Origin
  • removed: variable ProxiesTypes
  • added: async method Request.aread() -> bytes
  • added: method Request.read() -> bytes
  • added: method Response.close() -> None
  • added: method Response.iter_bytes() -> typing.Iterator[bytes]
  • added: method Response.iter_lines() -> typing.Iterator[str]
  • added: method Response.iter_raw() -> typing.Iterator[bytes]
  • added: method Response.iter_text() -> typing.Iterator[str]
  • added: method Response.read() -> bytes
  • added: property Request.content -> bytes
  • added: variable ACCEPT_ENCODING
  • added: variable USER_AGENT
  • removed: function kv_format(**kwargs: typing.Any) -> str
  • added: function as_network_error(*exception_classes: type) -> typing.Iterator[None]