A next generation HTTP client for Python. 🦋
app=...
shortcut has been deprecated. Use the explicit style of transport=httpx.WSGITransport()
or transport=httpx.ASGITransport()
instead.http1
argument while configuring proxy transports. (#3023)proxy
argument was added. You should use the proxy
argument instead of the deprecated proxies
, or use mounts=
for more complex configurations. (#2879)proxies
argument is now deprecated. It will still continue to work, but it will be removed in the future. (#2879)NO_PROXY
envvar cases when a fully qualified URL is supplied as the value. (#2741)raw_path
does not include URL query component. (#2999)Response.iter_text()
cannot yield empty strings. (#2998)Extensions
from Mapping[Str, Any]
to MutableMapping[Str, Any]
. (#2803)socket_options
argument to httpx.HTTPTransport
and httpx.AsyncHTTPTransport
classes. (#2716)Response.raise_for_status()
method now returns the response instance. For example: data = httpx.get('...').raise_for_status().json()
. (#2776)500
error response instead of exceptions when raise_app_exceptions=False
is set on ASGITransport
. (#2669)WSGITransport
environs have a SERVER_PROTOCOL
. (#2708)%2F
in query parameters (#2723)httpstatuses.com
for HTTP error reference (#2768)InvalidURL
exceptions. (#2675)NO_PROXY
environment variable. (#2659)NetRCAuth()
to None
to use the stdlib default. (#2667)TRACE
log level, and we no longer use the HTTPX_LOG_LEVEL
environment variable to auto-configure logging. We now have a significant amount of DEBUG
logging available at the network level. Full documentation is available at https://www.python-httpx.org/logging/ (#2547, encode/httpcore#648)Response.iter_lines()
method now matches the stdlib behaviour and does not include the newline characters. It also resolves a performance issue. (#2423)requests
, but is in line with browser behavior in Chrome, Safari, and Firefox. Both options are RFC valid. (#2543)httpx.NetRCAuth()
authentication class. See the documentation at https://www.python-httpx.org/advanced/#netrc-support (#2525)rfc3986
dependancy has been removed. (#2252)Content-Length
. (#2382)TypeError
if content is passed a dict-instance. (#2495)RawURL
. We continue to expose a url.raw
property which is now a plain named-tuple. This API is still expected to be deprecated, but we will do so with a major version bump. (#2481)Content-Type
header. (#2278)tuple
or list
for multipart values, not just list
. (#2355)str
content for multipart upload files. (#2400).read
/.aread
from SyncByteStream/AsyncByteStream (#2407)RawURL
. (#2241)