All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- Fix issue with concurrent connection acquiry. (Pull #700)
- Fix write error on closing HTTP/2 connections. (Pull #699)
The 0.10.0 release makes some changes that will allow us to support both sync and async interfaces.
In particular with streaming responses the response.read() method becomes response.aread(), and the response.close() method becomes response.aclose().
If following redirects explicitly the response.next() method becomes response.anext().
- End HTTP/2 streams immediately on no-body requests, rather than sending an empty body message. (Pull #682)
- Improve typing for
Response.request: switch fromOptional[Request]toRequest. (Pull #666) Response.elapsednow reflects the entire download time. (Pull #687, #692)
- Added
AsyncClientas a synonym forClient. (Pull #680) - Switch to
response.aread()for conditionally reading streaming responses. (Pull #674) - Switch to
response.aclose()andclient.aclose()for explicit closing. (Pull #674, #675) - Switch to
response.anext()for resolving the next redirect response. (Pull #676)
- When using a client instance, the per-request usage of
verify,cert, andtrust_envhave now escalated from raising a warning to raising an error. You should set these arguments on the client instead. (Pull #617) - Removed the undocumented
request.read(), since end users should not require it.
- Fix Host header and HSTS rewrites when an explicit
:80port is included in URL. (Pull #649) - Query Params on the URL string are merged with any
params=...argument. (Pull #653) - More robust behavior when closing connections. (Pull #640)
- More robust behavior when handling HTTP/2 headers with trailing whitespace. (Pull #637)
- Allow any explicit
Content-Typeheader to take precedence over the encoding default. (Pull #633)
- Added expiry to Keep-Alive connections, resolving issues with acquiring connections. (Pull #627)
- Increased flow control windows on HTTP/2, resolving download speed issues. (Pull #629)
- Fixed HTTP/2 with autodetection backend. (Pull #614)
- Released due to packaging build artifact.
- Released due to packaging build artifact.
The 0.9 releases brings some major new features, including:
- A new streaming API.
- Autodetection of either asyncio or trio.
- Nicer timeout configuration.
- HTTP/2 support off by default, but can be enabled.
We've also removed all private types from the top-level package export.
In order to ensure you are only ever working with public API you should make
sure to only import the top-level package eg. import httpx, rather than
importing modules within the package.
- Added concurrency backend autodetection. (Pull #585)
- Added
Client(backend='trio')andClient(backend='asyncio')API. (Pull #585) - Added
response.stream_lines()API. (Pull #575) - Added
response.is_errorAPI. (Pull #574) - Added support for
timeout=Timeout(5.0, connect_timeout=60.0)styles. (Pull #593)
- Requests or Clients with
timeout=Nonenow correctly always disable timeouts. (Pull #592) - Request 'Authorization' headers now have priority over
.netrcauthentication info. (Commit 095b691) - Files without a filename no longer set a Content-Type in multipart data. (Commit ed94950)
- Added
httpx.stream()API. Usingstream=Truenow results in a warning. (Pull #600, #610) - HTTP/2 support is switched to "off by default", but can be enabled explicitly. (Pull #584)
- Switched to
Client(http2=True)API fromClient(http_versions=["HTTP/1.1", "HTTP/2"]). (Pull #586) - Removed all private types from the top-level package export. (Pull #608)
- The SSL configuration settings of
verify,cert, andtrust_envnow raise warnings if used per-request when using a Client instance. They should always be set on the Client instance itself. (Pull #597) - Use plain strings "TUNNEL_ONLY" or "FORWARD_ONLY" on the HTTPProxy
proxy_modeargument. TheHTTPProxyModeenum still exists, but its usage will raise warnings. (#610) - Pool timeouts are now on the timeout configuration, not the pool limits configuration. (Pull #563)
- The timeout configuration is now named
httpx.Timeout(...), nothttpx.TimeoutConfig(...). The old version currently remains as a synonym for backwards compatability. (Pull #591)
- The synchronous API has been removed, in order to allow us to fundamentally change how we approach supporting both sync and async variants. (See #588 for more details.)
- Add support for proxy tunnels for Python 3.6 + asyncio. (Pull #521)
- Resolve an issue with cookies behavior on redirect requests. (Pull #529)
- Add request/response DEBUG logs. (Pull #502)
- Use TRACE log level for low level info. (Pull #500)
- Drop
proxiesparameter from the high-level API. (Pull #485)
- Tweak multipart files: omit null filenames, add support for
strfile contents. (Pull #482) - Cache NETRC authentication per-client. (Pull #400)
- Rely on
getproxiesfor all proxy environment variables. (Pull #470) - Wait for the
asynciostream to close when closing a connection. (Pull #494)
- Allow lists of values to be passed to
params. (Pull #386) ASGIDispatch,WSGIDispatchare now available in thehttpx.dispatchnamespace. (Pull #407)HTTPErroris now available in thehttpxnamespace. (Pull #421)- Add support for
start_tls()to the Trio concurrency backend. (Pull #467)
- Username and password are no longer included in the
Hostheader when basic authentication credentials are supplied via the URL. (Pull #417)
- The
.delete()function no longer hasjson,data, orfilesparameters to match the expected semantics of theDELETEmethod. (Pull #408) - Removed the
trioextra. Trio support is detected automatically. (Pull #390)
- Add Trio concurrency backend. (Pull #276)
- Add
paramsparameter toClientfor setting default query parameters. (Pull #372) - Add support for
SSL_CERT_FILEandSSL_CERT_DIRenvironment variables. (Pull #307) - Add debug logging to calls into ASGI apps. (Pull #371)
- Add debug logging to SSL configuration. (Pull #378)
- Fix a bug when using
Clientwithout timeouts in Python 3.6. (Pull #383) - Propagate
Clientconfiguration to HTTP proxies. (Pull #377)
- HTTP Proxy support. (Pulls #259, #353)
- Add Digest authentication. (Pull #332)
- Add
.build_request()method toClientandAsyncClient. (Pull #319) - Add
.elapsedproperty on responses. (Pull #351) - Add support for
SSLKEYLOGFILEin Python 3.8b4+. (Pull #301)
- Drop NPN support for HTTP version negotiation. (Pull #314)
- Fix distribution of type annotations for mypy (Pull #361).
- Set
Hostheader when redirecting cross-origin. (Pull #321) - Drop
Content-Lengthheaders onGETredirects. (Pull #310) - Raise
KeyErrorif header isn't found inHeaders. (Pull #324) - Raise
NotRedirectResponseinresponse.next()if there is no redirection to perform. (Pull #297) - Fix bug in calculating the HTTP/2 maximum frame size. (Pull #153)
- Enforce using
httpx.AsyncioBackendfor the synchronous client. (Pull #232) httpx.ConnectionPoolwill properly release a dropped connection. (Pull #230)- Remove the
raise_app_exceptionsargument fromClient. (Pull #238) DecodeErrorwill no longer be raised for an empty body encoded with Brotli. (Pull #237)- Added
http_versionsparameter toClient. (Pull #250) - Only use HTTP/1.1 on short-lived connections like
httpx.get(). (Pull #284) - Convert
Client.cookiesandClient.headerswhen set as a property. (Pull #274) - Setting
HTTPX_DEBUG=1enables debug logging on all requests. (Pull #277)
- Include files with source distribution to be installable. (Pull #233)
- Add the
trust_envproperty toBaseClient. (Pull #187) - Add the
linksproperty toBaseResponse. (Pull #211) - Accept
ssl.SSLContextinstances intoSSLConfig(verify=...). (Pull #215) - Add
Response.stream_text()with incremental encoding detection. (Pull #183) - Properly updated the
Hostheader when a redirect changes the origin. (Pull #199) - Ignore invalid
Content-Encodingheaders. (Pull #196) - Use
~/.netrcand~/_netrcfiles by default whentrust_env=True. (Pull #189) - Create exception base class
HTTPErrorwithrequestandresponseproperties. (Pull #162) - Add HSTS preload list checking within
BaseClientto upgrade HTTP URLs to HTTPS. (Pull #184) - Switch IDNA encoding from IDNA 2003 to IDNA 2008. (Pull #161)
- Expose base classes for alternate concurrency backends. (Pull #178)
- Improve Multipart parameter encoding. (Pull #167)
- Add the
headersproeprty toBaseClient. (Pull #159) - Add support for Google's
brotlilibrary. (Pull #156) - Remove deprecated TLS versions (TLSv1 and TLSv1.1) from default
SSLConfig. (Pull #155) - Fix
URL.join(...)to work similarly to RFC 3986 URL joining. (Pull #144)
- Check for disconnections when searching for an available
connection in
ConnectionPool.keepalive_connections(Pull #145) - Allow string comparison for
URLobjects (Pull #139) - Add HTTP status codes 418 and 451 (Pull #135)
- Add support for client certificate passwords (Pull #118)
- Enable post-handshake client cert authentication for TLSv1.3 (Pull #118)
- Disable using
commonNamefor hostname checking for OpenSSL 1.1.0+ (Pull #118) - Detect encoding for
Response.json()(Pull #116)
- Check for connection aliveness on re-acquiry (Pull #111)
- Improve
USER_AGENT(Pull #110) - Add
Connection: keep-aliveby default to HTTP/1.1 connections. (Pull #110)
- Include
Hostheader by default. (Pull #109) - Improve HTTP protocol detection. (Pull #107)
- Implement read and write timeouts (Pull #104)
- Handle early connection closes (Pull #103)
- Use urllib3's
DEFAULT_CIPHERSfor theSSLConfigobject. (Pull #100)
- Add support for setting a
base_urlon theClient.
- Honor
local_flow_control_windowfor HTTP/2 connections (Pull #98)