CHANGELOG.md
This file
Path
CHANGELOG.md
927 lines · 43.0 KiB · Markdown
Last changed by
Version 0.22.0 (#2048)Tom Christiebefore adoption15c51b9
History of this fileTake it
The walk stopped after 200 commits: lines older than 3c89b91 point at it.
Update exceptions.md (#1432)Gerhard van Andelbefore adoption3c89b91
lines 1–6why, one step back1# Changelog23All notable changes to this project will be documented in this file.45The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).6Version 0.22.0 (#2048)Tom Christiebefore adoption15c51b9
lines 7–18why, one step back7## 0.22.0 (26th January, 2022)89### Added1011* Support for [the SOCKS5 proxy protocol](https://www.python-httpx.org/advanced/#socks) via [the `socksio` package](https://github.com/sethmlarson/socksio). (#2034)12* Support for custom headers in multipart/form-data requests (#1936)1314### Fixed1516* Don't perform unreliable close/warning on `__del__` with unclosed clients. (#2026)17* Fix `Headers.update(...)` to correctly handle repeated headers (#2038)18Version 0.21.3 (#2017)Tom Christiebefore adoption07f786c
lines 19–22why, one step back19## 0.21.3 (6th January, 2022)2021### Fixed22Fix typo in change-log. (#2018)Tom Christiebefore adoptionc6c8cb1
line 23why, one step back23* Fix streaming uploads using `SyncByteStream` or `AsyncByteStream`. Regression in 0.21.2. (#2016)Version 0.21.3 (#2017)Tom Christiebefore adoption07f786c
line 24why, one step back24Version 0.21.2 (#2011)Tom Christiebefore adoptionf6b7657
lines 25–31why, one step back25## 0.21.2 (5th January, 2022)2627### Fixed2829* HTTP/2 support for tunnelled proxy cases. (#2009)30* Improved the speed of large file uploads. (#1948)31Version 0.21.1 (#1941)Tom Christiebefore adoption716749e
lines 32–37why, one step back32## 0.21.1 (16th November, 2021)3334### Fixed3536* The `response.url` property is now correctly annotated as `URL`, instead of `Optional[URL]`. (#1940)37Version 0.21 release notes (#1938)Tom Christiebefore adoptionb4f6069
lines 38–55why, one step back38## 0.21.0 (15th November, 2021)3940The 0.21.0 release integrates against a newly redesigned `httpcore` backend.4142Both packages ought to automatically update to the required versions, but if you are43seeing any issues, you should ensure that you have `httpx==0.21.*` and `httpcore==0.14.*` installed.4445### Added4647* The command-line client will now display connection information when `-v/--verbose` is used.48* The command-line client will now display server certificate information when `-v/--verbose` is used.49* The command-line client is now able to properly detect if the outgoing request50should be formatted as HTTP/1.1 or HTTP/2, based on the result of the HTTP/2 negotiation.5152### Removed5354* Curio support is no longer currently included. Please get in touch if you require this, so that we can assess priorities.55Version 0.20 (#1890)Tom Christiebefore adoption35164b7
line 56why, one step back56## 0.20.0 (13th October, 2021)Add cli support (#1855)Tom Christiebefore adoptionee9250d
line 57why, one step back57Version 0.20 (#1890)Tom Christiebefore adoption35164b7
line 58why, one step back58The 0.20.0 release adds an integrated command-line client, and also includes someAdd cli support (#1855)Tom Christiebefore adoptionee9250d
lines 59–119why, one step back59design changes. The most notable of these is that redirect responses are no longer60automatically followed, unless specifically requested.6162This design decision prioritises a more explicit approach to redirects, in order63to avoid code that unintentionally issues multiple requests as a result of64misconfigured URLs.6566For example, previously a client configured to send requests to `http://api.github.com/`67would end up sending every API request twice, as each request would be redirected to `https://api.github.com/`.6869If you do want auto-redirect behaviour, you can enable this either by configuring70the client instance with `Client(follow_redirects=True)`, or on a per-request71basis, with `.get(..., follow_redirects=True)`.7273This change is a classic trade-off between convenience and precision, with no "right"74answer. See [discussion #1785](https://github.com/encode/httpx/discussions/1785) for more75context.7677The other major design change is an update to the Transport API, which is the low-level78interface against which requests are sent. Previously this interface used only primitive79datastructures, like so...8081```python82(status_code, headers, stream, extensions) = transport.handle_request(method, url, headers, stream, extensions)83try84 ...85finally:86 stream.close()87```8889Now the interface is much simpler...9091```python92response = transport.handle_request(request)93try94 ...95finally:96 response.close()97```9899### Changed100101* The `allow_redirects` flag is now `follow_redirects` and defaults to `False`.102* The `raise_for_status()` method will now raise an exception for any responses103 except those with 2xx status codes. Previously only 4xx and 5xx status codes104 would result in an exception.105* The low-level transport API changes to the much simpler `response = transport.handle_request(request)`.106* The `client.send()` method no longer accepts a `timeout=...` argument, but the107 `client.build_request()` does. This required by the signature change of the108 Transport API. The request timeout configuration is now stored on the request109 instance, as `request.extensions['timeout']`.110111### Added112113* Added the `httpx` command-line client.114* Response instances now include `.is_informational`, `.is_success`, `.is_redirect`, `.is_client_error`, and `.is_server_error`115 properties for checking 1xx, 2xx, 3xx, 4xx, and 5xx response types. Note that the behaviour of `.is_redirect` is slightly different in that it now returns True for all 3xx responses, in order to allow for a consistent set of properties onto the different HTTP status code types. The `response.has_redirect_location` location may be used to determine responses with properly formed URL redirects.116117### Fixed118119* `response.iter_bytes()` no longer raises a ValueError when called on a response with no content. (Pull #1827)Fix typos (#1968)Kian Meng, Angbefore adoption82ba15b
line 120why, one step back120* The `'wsgi.error'` configuration now defaults to `sys.stderr`, and is corrected to be a `TextIO` interface, not a `BytesIO` interface. Additionally, the WSGITransport now accepts a `wsgi_error` configuration. (Pull #1828)Add cli support (#1855)Tom Christiebefore adoptionee9250d
lines 121–122why, one step back121* Follow the WSGI spec by properly closing the iterable returned by the application. (Pull #1830)122Fix 0.19.0 release date in CHANGELOG (#1811)Florimond Mancabefore adoption35de3df
line 123why, one step back123## 0.19.0 (19th August, 2021)Version 0.19.0 (#1809)Tom Christiebefore adoption0d7c4ca
lines 124–136why, one step back124125### Added126127* Add support for `Client(allow_redirects=<bool>)`. (Pull #1790)128* Add automatic character set detection, when no `charset` is included in the response `Content-Type` header. (Pull #1791)129130### Changed131132* Event hooks are now also called for any additional redirect or auth requests/responses. (Pull #1806)133* Strictly enforce that upload files must be opened in binary mode. (Pull #1736)134* Strictly enforce that client instances can only be opened and closed once, and cannot be re-opened. (Pull #1800)135* Drop `mode` argument from `httpx.Proxy(..., mode=...)`. (Pull #1795)136Version 0.18.2 (#1690)Tom Christiebefore adoptionf312e62
lines 137–149why, one step back137## 0.18.2 (17th June, 2021)138139### Added140141* Support for Python 3.10. (Pull #1687)142* Expose `httpx.USE_CLIENT_DEFAULT`, used as the default to `auth` and `timeout` parameters in request methods. (Pull #1634)143* Support [HTTP/2 "prior knowledge"](https://python-hyper.org/projects/hyper-h2/en/v2.3.1/negotiating-http2.html#prior-knowledge), using `httpx.Client(http1=False, http2=True)`. (Pull #1624)144145### Fixed146147* Clean up some cases where warnings were being issued. (Pull #1687)148* Prefer Content-Length over Transfer-Encoding: chunked for content=<file-like> cases. (Pull #1619)149Version 0.18.1 (#1617)Tom Christiebefore adoption54f4194
lines 150–161why, one step back150## 0.18.1 (29th April, 2021)151152### Changed153154* Update brotli support to use the `brotlicffi` package (Pull #1605)155* Ensure that `Request(..., stream=...)` does not auto-generate any headers on the request instance. (Pull #1607)156157### Fixed158159* Pass through `timeout=...` in top-level httpx.stream() function. (Pull #1613)160* Map httpcore transport close exceptions to httpx exceptions. (Pull #1606)161Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
line 162why, one step back162## 0.18.0 (27th April, 2021)Version 0.17.1 (#1505)Tom Christiebefore adoption2e6930f
line 163why, one step back163Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
line 164why, one step back164The 0.18.x release series formalises our low-level Transport API, introducing the base classes `httpx.BaseTransport` and `httpx.AsyncBaseTransport`.Transport API (#1522)Tom Christiebefore adoption1a6e254
line 165why, one step back165Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
line 166why, one step back166See the "[Writing custom transports](https://www.python-httpx.org/advanced/#writing-custom-transports)" documentation and the [`httpx.BaseTransport.handle_request()`](https://github.com/encode/httpx/blob/397aad98fdc8b7580a5fc3e88f1578b4302c6382/httpx/_transports/base.py#L77-L147) docstring for more complete details on implementing custom transports.Transport API (#1522)Tom Christiebefore adoption1a6e254
line 167why, one step back167Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
line 168why, one step back168Pull request #1522 includes a checklist of differences from the previous `httpcore` transport API, for developers implementing custom transports.Transport API (#1522)Tom Christiebefore adoption1a6e254
line 169why, one step back169Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
lines 170–175why, one step back170The following API changes have been issuing deprecation warnings since 0.17.0 onwards, and are now fully deprecated...171172* You should now use httpx.codes consistently instead of httpx.StatusCodes.173* Use limits=... instead of pool_limits=....174* Use proxies={"http://": ...} instead of proxies={"http": ...} for scheme-specific mounting.175Transport API (#1522)Tom Christiebefore adoption1a6e254
lines 176–178why, one step back176### Changed177178* Transport instances now inherit from `httpx.BaseTransport` or `httpx.AsyncBaseTransport`,Version 0.18.0 (#1576)Tom Christiebefore adoption0c2cb24
lines 179–202why, one step back179 and should implement either the `handle_request` method or `handle_async_request` method. (Pull #1522, #1550)180* The `response.ext` property and `Response(ext=...)` argument are now named `extensions`. (Pull #1522)181* The recommendation to not use `data=<bytes|str|bytes (a)iterator>` in favour of `content=<bytes|str|bytes (a)iterator>` has now been escalated to a deprecation warning. (Pull #1573)182* Drop `Response(on_close=...)` from API, since it was a bit of leaking implementation detail. (Pull #1572)183* When using a client instance, cookies should always be set on the client, rather than on a per-request basis. We prefer enforcing a stricter API here because it provides clearer expectations around cookie persistence, particularly when redirects occur. (Pull #1574)184* The runtime exception `httpx.ResponseClosed` is now named `httpx.StreamClosed`. (#1584)185* The `httpx.QueryParams` model now presents an immutable interface. There is a discussion on [the design and motivation here](https://github.com/encode/httpx/discussions/1599). Use `client.params = client.params.merge(...)` instead of `client.params.update(...)`. The basic query manipulation methods are `query.set(...)`, `query.add(...)`, and `query.remove()`. (#1600)186187### Added188189* The `Request` and `Response` classes can now be serialized using pickle. (#1579)190* Handle `data={"key": [None|int|float|bool]}` cases. (Pull #1539)191* Support `httpx.URL(**kwargs)`, for example `httpx.URL(scheme="https", host="www.example.com", path="/')`, or `httpx.URL("https://www.example.com/", username="tom@gmail.com", password="123 456")`. (Pull #1601)192* Support `url.copy_with(params=...)`. (Pull #1601)193* Add `url.params` parameter, returning an immutable `QueryParams` instance. (Pull #1601)194* Support query manipulation methods on the URL class. These are `url.copy_set_param()`, `url.copy_add_param()`, `url.copy_remove_param()`, `url.copy_merge_params()`. (Pull #1601)195* The `httpx.URL` class now performs port normalization, so `:80` ports are stripped from `http` URLs and `:443` ports are stripped from `https` URLs. (Pull #1603)196* The `URL.host` property returns unicode strings for internationalized domain names. The `URL.raw_host` property returns byte strings with IDNA escaping applied. (Pull #1590)197198### Fixed199200* Fix Content-Length for cases of `files=...` where unicode string is used as the file content. (Pull #1537)201* Fix some cases of merging relative URLs against `Client(base_url=...)`. (Pull #1532)202* The `request.content` attribute is now always available except for streaming content, which requires an explicit `.read()`. (Pull #1583)Transport API (#1522)Tom Christiebefore adoption1a6e254
lines 203–205why, one step back203204## 0.17.1 (March 15th, 2021)205Version 0.17.1 (#1505)Tom Christiebefore adoption2e6930f
lines 206–210why, one step back206### Fixed207208* Type annotation on `CertTypes` allows `keyfile` and `password` to be optional. (Pull #1503)209* Fix httpcore pinned version. (Pull #1495)210Transport API (#1522)Tom Christiebefore adoption1a6e254
line 211why, one step back211## 0.17.0 (February 28th, 2021)Version 0.17.0 (#1403)Tom Christiebefore adoption59f65e2
lines 212–231why, one step back212213### Added214215* Add `httpx.MockTransport()`, allowing to mock out a transport using pre-determined responses. (Pull #1401, Pull #1449)216* Add `httpx.HTTPTransport()` and `httpx.AsyncHTTPTransport()` default transports. (Pull #1399)217* Add mount API support, using `httpx.Client(mounts=...)`. (Pull #1362)218* Add `chunk_size` parameter to `iter_raw()`, `iter_bytes()`, `iter_text()`. (Pull #1277)219* Add `keepalive_expiry` parameter to `httpx.Limits()` configuration. (Pull #1398)220* Add repr to `httpx.Cookies` to display available cookies. (Pull #1411)221* Add support for `params=<tuple>` (previously only `params=<list>` was supported). (Pull #1426)222223### Fixed224225* Add missing `raw_path` to ASGI scope. (Pull #1357)226* Tweak `create_ssl_context` defaults to use `trust_env=True`. (Pull #1447)227* Properly URL-escape WSGI `PATH_INFO`. (Pull #1391)228* Properly set default ports in WSGI transport. (Pull #1469)229* Properly encode slashes when using `base_url`. (Pull #1407)230* Properly map exceptions in `request.aclose()`. (Pull #1465)231Update exceptions.md (#1432)Gerhard van Andelbefore adoption3c89b91
lines 232–374why, one step back232## 0.16.1 (October 8th, 2020)233234### Fixed235236* Support literal IPv6 addresses in URLs. (Pull #1349)237* Force lowercase headers in ASGI scope dictionaries. (Pull #1351)238239## 0.16.0 (October 6th, 2020)240241### Changed242243* Preserve HTTP header casing. (Pull #1338, encode/httpcore#216, python-hyper/h11#104)244* Drop `response.next()` and `response.anext()` methods in favour of `response.next_request` attribute. (Pull #1339)245* Closed clients now raise a runtime error if attempting to send a request. (Pull #1346)246247### Added248249* Add Python 3.9 to officially supported versions.250* Type annotate `__enter__`/`__exit__`/`__aenter__`/`__aexit__` in a way that supports subclasses of `Client` and `AsyncClient`. (Pull #1336)251252## 0.15.5 (October 1st, 2020)253254### Added255256* Add `response.next_request` (Pull #1334)257258## 0.15.4 (September 25th, 2020)259260### Added261262* Support direct comparisons between `Headers` and dicts or lists of two-tuples. Eg. `assert response.headers == {"Content-Length": 24}` (Pull #1326)263264### Fixed265266* Fix automatic `.read()` when `Response` instances are created with `content=<str>` (Pull #1324)267268## 0.15.3 (September 24th, 2020)269270### Fixed271272* Fixed connection leak in async client due to improper closing of response streams. (Pull #1316)273274## 0.15.2 (September 23nd, 2020)275276### Fixed277278* Fixed `response.elapsed` property. (Pull #1313)279* Fixed client authentication interaction with `.stream()`. (Pull #1312)280281## 0.15.1 (September 23nd, 2020)282283### Fixed284285* ASGITransport now properly applies URL decoding to the `path` component, as-per the ASGI spec. (Pull #1307)286287## 0.15.0 (September 22nd, 2020)288289### Added290291* Added support for curio. (Pull https://github.com/encode/httpcore/pull/168)292* Added support for event hooks. (Pull #1246)293* Added support for authentication flows which require either sync or async I/O. (Pull #1217)294* Added support for monitoring download progress with `response.num_bytes_downloaded`. (Pull #1268)295* Added `Request(content=...)` for byte content, instead of overloading `Request(data=...)` (Pull #1266)296* Added support for all URL components as parameter names when using `url.copy_with(...)`. (Pull #1285)297* Neater split between automatically populated headers on `Request` instances, vs default `client.headers`. (Pull #1248)298* Unclosed `AsyncClient` instances will now raise warnings if garbage collected. (Pull #1197)299* Support `Response(content=..., text=..., html=..., json=...)` for creating usable response instances in code. (Pull #1265, #1297)300* Support instantiating requests from the low-level transport API. (Pull #1293)301* Raise errors on invalid URL types. (Pull #1259)302303### Changed304305* Cleaned up expected behaviour for URL escaping. `url.path` is now URL escaped. (Pull #1285)306* Cleaned up expected behaviour for bytes vs str in URL components. `url.userinfo` and `url.query` are not URL escaped, and so return bytes. (Pull #1285)307* Drop `url.authority` property in favour of `url.netloc`, since "authority" was semantically incorrect. (Pull #1285)308* Drop `url.full_path` property in favour of `url.raw_path`, for better consistency with other parts of the API. (Pull #1285)309* No longer use the `chardet` library for auto-detecting charsets, instead defaulting to a simpler approach when no charset is specified. (#1269)310311### Fixed312313* Swapped ordering of redirects and authentication flow. (Pull #1267)314* `.netrc` lookups should use host, not host+port. (Pull #1298)315316### Removed317318* The `URLLib3Transport` class no longer exists. We've published it instead as an example of [a custom transport class](https://gist.github.com/florimondmanca/d56764d78d748eb9f73165da388e546e). (Pull #1182)319* Drop `request.timer` attribute, which was being used internally to set `response.elapsed`. (Pull #1249)320* Drop `response.decoder` attribute, which was being used internally. (Pull #1276)321* `Request.prepare()` is now a private method. (Pull #1284)322* The `Headers.getlist()` method had previously been deprecated in favour of `Headers.get_list()`. It is now fully removed.323* The `QueryParams.getlist()` method had previously been deprecated in favour of `QueryParams.get_list()`. It is now fully removed.324* The `URL.is_ssl` property had previously been deprecated in favour of `URL.scheme == "https"`. It is now fully removed.325* The `httpx.PoolLimits` class had previously been deprecated in favour of `httpx.Limits`. It is now fully removed.326* The `max_keepalive` setting had previously been deprecated in favour of the more explicit `max_keepalive_connections`. It is now fully removed.327* The verbose `httpx.Timeout(5.0, connect_timeout=60.0)` style had previously been deprecated in favour of `httpx.Timeout(5.0, connect=60.0)`. It is now fully removed.328* Support for instantiating a timeout config missing some defaults, such as `httpx.Timeout(connect=60.0)`, had previously been deprecated in favour of enforcing a more explicit style, such as `httpx.Timeout(5.0, connect=60.0)`. This is now strictly enforced.329330## 0.14.3 (September 2nd, 2020)331332### Added333334* `http.Response()` may now be instantiated without a `request=...` parameter. Useful for some unit testing cases. (Pull #1238)335* Add `103 Early Hints` and `425 Too Early` status codes. (Pull #1244)336337### Fixed338339* `DigestAuth` now handles responses that include multiple 'WWW-Authenticate' headers. (Pull #1240)340* Call into transport `__enter__`/`__exit__` or `__aenter__`/`__aexit__` when client is used in a context manager style. (Pull #1218)341342## 0.14.2 (August 24th, 2020)343344### Added345346* Support `client.get(..., auth=None)` to bypass the default authentication on a clients. (Pull #1115)347* Support `client.auth = ...` property setter. (Pull #1185)348* Support `httpx.get(..., proxies=...)` on top-level request functions. (Pull #1198)349* Display instances with nicer import styles. (Eg. <httpx.ReadTimeout ...>) (Pull #1155)350* Support `cookies=[(key, value)]` list-of-two-tuples style usage. (Pull #1211)351352### Fixed353354* Ensure that automatically included headers on a request may be modified. (Pull #1205)355* Allow explicit `Content-Length` header on streaming requests. (Pull #1170)356* Handle URL quoted usernames and passwords properly. (Pull #1159)357* Use more consistent default for `HEAD` requests, setting `allow_redirects=True`. (Pull #1183)358* If a transport error occurs while streaming the response, raise an `httpx` exception, not the underlying `httpcore` exception. (Pull #1190)359* Include the underlying `httpcore` traceback, when transport exceptions occur. (Pull #1199)360361## 0.14.1 (August 11th, 2020)362363### Added364365* The `httpx.URL(...)` class now raises `httpx.InvalidURL` on invalid URLs, rather than exposing the underlying `rfc3986` exception. If a redirect response includes an invalid 'Location' header, then a `RemoteProtocolError` exception is raised, which will be associated with the request that caused it. (Pull #1163)366367### Fixed368369* Handling multiple `Set-Cookie` headers became broken in the 0.14.0 release, and is now resolved. (Pull #1156)370371## 0.14.0 (August 7th, 2020)372373The 0.14 release includes a range of improvements to the public API, intended on preparing for our upcoming 1.0 release.374Fix typos (#1968)Kian Meng, Angbefore adoption82ba15b
line 375why, one step back375* Our HTTP/2 support is now fully optional. **You now need to use `pip install httpx[http2]` if you want to include the HTTP/2 dependencies.**Update exceptions.md (#1432)Gerhard van Andelbefore adoption3c89b91
lines 376–747why, one step back376* Our HSTS support has now been removed. Rewriting URLs from `http` to `https` if the host is on the HSTS list can be beneficial in avoiding roundtrips to incorrectly formed URLs, but on balance we've decided to remove this feature, on the principle of least surprise. Most programmatic clients do not include HSTS support, and for now we're opting to remove our support for it.377* Our exception hierarchy has been overhauled. Most users will want to stick with their existing `httpx.HTTPError` usage, but we've got a clearer overall structure now. See https://www.python-httpx.org/exceptions/ for more details.378379When upgrading you should be aware of the following public API changes. Note that deprecated usages will currently continue to function, but will issue warnings.380381* You should now use `httpx.codes` consistently instead of `httpx.StatusCodes`.382* Usage of `httpx.Timeout()` should now always include an explicit default. Eg. `httpx.Timeout(None, pool=5.0)`.383* When using `httpx.Timeout()`, we now have more concisely named keyword arguments. Eg. `read=5.0`, instead of `read_timeout=5.0`.384* Use `httpx.Limits()` instead of `httpx.PoolLimits()`, and `limits=...` instead of `pool_limits=...`.385* The `httpx.Limits(max_keepalive=...)` argument is now deprecated in favour of a more explicit `httpx.Limits(max_keepalive_connections=...)`.386* Keys used with `Client(proxies={...})` should now be in the style of `{"http://": ...}`, rather than `{"http": ...}`.387* The multidict methods `Headers.getlist()` and `QueryParams.getlist()` are deprecated in favour of more consistent `.get_list()` variants.388* The `URL.is_ssl` property is deprecated in favour of `URL.scheme == "https"`.389* The `URL.join(relative_url=...)` method is now `URL.join(url=...)`. This change does not support warnings for the deprecated usage style.390391One notable aspect of the 0.14.0 release is that it tightens up the public API for `httpx`, by ensuring that several internal attributes and methods have now become strictly private.392393The following previously had nominally public names on the client, but were all undocumented and intended solely for internal usage. They are all now replaced with underscored names, and should not be relied on or accessed.394395These changes should not affect users who have been working from the `httpx` documentation.396397* `.merge_url()`, `.merge_headers()`, `.merge_cookies()`, `.merge_queryparams()`398* `.build_auth()`, `.build_redirect_request()`399* `.redirect_method()`, `.redirect_url()`, `.redirect_headers()`, `.redirect_stream()`400* `.send_handling_redirects()`, `.send_handling_auth()`, `.send_single_request()`401* `.init_transport()`, `.init_proxy_transport()`402* `.proxies`, `.transport`, `.netrc`, `.get_proxy_map()`403404See pull requests #997, #1065, #1071.405406Some areas of API which were already on the deprecation path, and were raising warnings or errors in 0.13.x have now been escalated to being fully removed.407408* Drop `ASGIDispatch`, `WSGIDispatch`, which have been replaced by `ASGITransport`, `WSGITransport`.409* Drop `dispatch=...`` on client, which has been replaced by `transport=...``410* Drop `soft_limit`, `hard_limit`, which have been replaced by `max_keepalive` and `max_connections`.411* Drop `Response.stream` and` `Response.raw`, which have been replaced by ``.aiter_bytes` and `.aiter_raw`.412* Drop `proxies=<transport instance>` in favor of `proxies=httpx.Proxy(...)`.413414See pull requests #1057, #1058.415416### Added417418* Added dedicated exception class `httpx.HTTPStatusError` for `.raise_for_status()` exceptions. (Pull #1072)419* Added `httpx.create_ssl_context()` helper function. (Pull #996)420* Support for proxy exlcusions like `proxies={"https://www.example.com": None}`. (Pull #1099)421* Support `QueryParams(None)` and `client.params = None`. (Pull #1060)422423### Changed424425* Use `httpx.codes` consistently in favour of `httpx.StatusCodes` which is placed into deprecation. (Pull #1088)426* Usage of `httpx.Timeout()` should now always include an explicit default. Eg. `httpx.Timeout(None, pool=5.0)`. (Pull #1085)427* Switch to more concise `httpx.Timeout()` keyword arguments. Eg. `read=5.0`, instead of `read_timeout=5.0`. (Pull #1111)428* Use `httpx.Limits()` instead of `httpx.PoolLimits()`, and `limits=...` instead of `pool_limits=...`. (Pull #1113)429* Keys used with `Client(proxies={...})` should now be in the style of `{"http://": ...}`, rather than `{"http": ...}`. (Pull #1127)430* The multidict methods `Headers.getlist` and `QueryParams.getlist` are deprecated in favour of more consistent `.get_list()` variants. (Pull #1089)431* `URL.port` becomes `Optional[int]`. Now only returns a port if one is explicitly included in the URL string. (Pull #1080)432* The `URL(..., allow_relative=[bool])` parameter no longer exists. All URL instances may be relative. (Pull #1073)433* Drop unnecessary `url.full_path = ...` property setter. (Pull #1069)434* The `URL.join(relative_url=...)` method is now `URL.join(url=...)`. (Pull #1129)435* The `URL.is_ssl` property is deprecated in favour of `URL.scheme == "https"`. (Pull #1128)436437### Fixed438439* Add missing `Response.next()` method. (Pull #1055)440* Ensure all exception classes are exposed as public API. (Pull #1045)441* Support multiple items with an identical field name in multipart encodings. (Pull #777)442* Skip HSTS preloading on single-label domains. (Pull #1074)443* Fixes for `Response.iter_lines()`. (Pull #1033, #1075)444* Ignore permission errors when accessing `.netrc` files. (Pull #1104)445* Allow bare hostnames in `HTTP_PROXY` etc... environment variables. (Pull #1120)446* Settings `app=...` or `transport=...` bypasses any environment based proxy defaults. (Pull #1122)447* Fix handling of `.base_url` when a path component is included in the base URL. (Pull #1130)448449---450451## 0.13.3 (May 29th, 2020)452453### Fixed454455* Include missing keepalive expiry configuration. (Pull #1005)456* Improved error message when URL redirect has a custom scheme. (Pull #1002)457458## 0.13.2 (May 27th, 2020)459460### Fixed461462* Include explicit "Content-Length: 0" on POST, PUT, PATCH if no request body is used. (Pull #995)463* Add `http2` option to `httpx.Client`. (Pull #982)464* Tighten up API typing in places. (Pull #992, #999)465466## 0.13.1 (May 22nd, 2020)467468### Fixed469470* Fix pool options deprecation warning. (Pull #980)471* Include `httpx.URLLib3ProxyTransport` in top-level API. (Pull #979)472473## 0.13.0 (May 22nd, 2020)474475This release switches to `httpcore` for all the internal networking, which means:476477* We're using the same codebase for both our sync and async clients.478* HTTP/2 support is now available with the sync client.479* We no longer have a `urllib3` dependency for our sync client, although there is still an *optional* `URLLib3Transport` class.480481It also means we've had to remove our UDS support, since maintaining that would have meant having to push back our work towards a 1.0 release, which isn't a trade-off we wanted to make.482483We also now have [a public "Transport API"](https://www.python-httpx.org/advanced/#custom-transports), which you can use to implement custom transport implementations against. This formalises and replaces our previously private "Dispatch API".484485### Changed486487* Use `httpcore` for underlying HTTP transport. Drop `urllib3` requirement. (Pull #804, #967)488* Rename pool limit options from `soft_limit`/`hard_limit` to `max_keepalive`/`max_connections`. (Pull #968)489* The previous private "Dispatch API" has now been promoted to a public "Transport API". When customizing the transport use `transport=...`. The `ASGIDispatch` and `WSGIDispatch` class naming is deprecated in favour of `ASGITransport` and `WSGITransport`. (Pull #963)490491### Added492493* Added `URLLib3Transport` class for optional `urllib3` transport support. (Pull #804, #963)494* Streaming multipart uploads. (Pull #857)495* Logging via HTTPCORE_LOG_LEVEL and HTTPX_LOG_LEVEL environment variables496and TRACE level logging. (Pull encode/httpcore#79)497498### Fixed499500* Performance improvement in brotli decoder. (Pull #906)501* Proper warning level of deprecation notice in `Response.stream` and `Response.raw`. (Pull #908)502* Fix support for generator based WSGI apps. (Pull #887)503* Reuse of connections on HTTP/2 in close concurrency situations. (Pull encode/httpcore#81)504* Honor HTTP/2 max concurrent streams settings (Pull encode/httpcore#89, encode/httpcore#90)505* Fix bytes support in multipart uploads. (Pull #974)506* Improve typing support for `files=...`. (Pull #976)507508### Removed509510* Dropped support for `Client(uds=...)` (Pull #804)511512## 0.13.0.dev2 (May 12th, 2020)513514The 0.13.0.dev2 is a *pre-release* version. To install it, use `pip install httpx --pre`.515516### Added517518* Logging via HTTPCORE_LOG_LEVEL and HTTPX_LOG_LEVEL environment variables519and TRACE level logging. (HTTPCore Pull #79)520521### Fixed522523* Reuse of connections on HTTP/2 in close concurrency situations. (HTTPCore Pull #81)524* When using an `app=<ASGI app>` observe neater disconnect behaviour instead of sending empty body messages. (Pull #919)525526## 0.13.0.dev1 (May 6th, 2020)527528The 0.13.0.dev1 is a *pre-release* version. To install it, use `pip install httpx --pre`.529530### Fixed531532* Passing `http2` flag to proxy dispatchers. (Pull #934)533* Use [`httpcore` v0.8.3](https://github.com/encode/httpcore/releases/tag/0.8.3)534which addresses problems in handling of headers when using proxies.535536## 0.13.0.dev0 (April 30th, 2020)537538The 0.13.0.dev0 is a *pre-release* version. To install it, use `pip install httpx --pre`.539540This release switches to `httpcore` for all the internal networking, which means:541542* We're using the same codebase for both our sync and async clients.543* HTTP/2 support is now available with the sync client.544* We no longer have a `urllib3` dependency for our sync client, although there is still an *optional* `URLLib3Dispatcher` class.545546It also means we've had to remove our UDS support, since maintaining that would have meant having to push back our work towards a 1.0 release, which isn't a trade-off we wanted to make.547548### Changed549550* Use `httpcore` for underlying HTTP transport. Drop `urllib3` requirement. (Pull #804)551552### Added553554* Added `URLLib3Dispatcher` class for optional `urllib3` transport support. (Pull #804)555* Streaming multipart uploads. (Pull #857)556557### Fixed558559* Performance improvement in brotli decoder. (Pull #906)560* Proper warning level of deprecation notice in `Response.stream` and `Response.raw`. (Pull #908)561* Fix support for generator based WSGI apps. (Pull #887)562563### Removed564565* Dropped support for `Client(uds=...)` (Pull #804)566567---568569## 0.12.1 (March 19th, 2020)570571### Fixed572573* Resolved packaging issue, where additional files were being included.574575## 0.12.0 (March 9th, 2020)576577The 0.12 release tightens up the API expectations for `httpx` by switching to private module names to enforce better clarity around public API.578579All imports of `httpx` should import from the top-level package only, such as `from httpx import Request`, rather than importing from privately namespaced modules such as `from httpx._models import Request`.580581### Added582583* Support making response body available to auth classes with `.requires_response_body`. (Pull #803)584* Export `NetworkError` exception. (Pull #814)585* Add support for `NO_PROXY` environment variable. (Pull #835)586587### Changed588589* Switched to private module names. (Pull #785)590* Drop redirect looping detection and the `RedirectLoop` exception, instead using `TooManyRedirects`. (Pull #819)591* Drop `backend=...` parameter on `AsyncClient`, in favour of always autodetecting `trio`/`asyncio`. (Pull #791)592593### Fixed594595* Support basic auth credentials in proxy URLs. (Pull #780)596* Fix `httpx.Proxy(url, mode="FORWARD_ONLY")` configuration. (Pull #788)597* Fallback to setting headers as UTF-8 if no encoding is specified. (Pull #820)598* Close proxy dispatches classes on client close. (Pull #826)599* Support custom `cert` parameters even if `verify=False`. (Pull #796)600* Don't support invalid dict-of-dicts form data in `data=...`. (Pull #811)601602---603604## 0.11.1 (January 17th, 2020)605606### Fixed607608* Fixed usage of `proxies=...` on `Client()`. (Pull #763)609* Support both `zlib` and `deflate` style encodings on `Content-Encoding: deflate`. (Pull #758)610* Fix for streaming a redirect response body with `allow_redirects=False`. (Pull #766)611* Handle redirect with malformed Location headers missing host. (Pull #774)612613## 0.11.0 (January 9th, 2020)614615The 0.11 release reintroduces our sync support, so that `httpx` now supports both a standard thread-concurrency API, and an async API.616617Existing async `httpx` users that are upgrading to 0.11 should ensure that:618619* Async codebases should always use a client instance to make requests, instead of the top-level API.620* The async client is named as `httpx.AsyncClient()`, instead of `httpx.Client()`.621* When instantiating proxy configurations use the `httpx.Proxy()` class, instead of the previous `httpx.HTTPProxy()`. This new configuration class works for configuring both sync and async clients.622623We believe the API is now pretty much stable, and are aiming for a 1.0 release sometime on or before April 2020.624625### Changed626627- Top level API such as `httpx.get(url, ...)`, `httpx.post(url, ...)`, `httpx.request(method, url, ...)` becomes synchronous.628- Added `httpx.Client()` for synchronous clients, with `httpx.AsyncClient` being used for async clients.629- Switched to `proxies=httpx.Proxy(...)` for proxy configuration.630- Network connection errors are wrapped in `httpx.NetworkError`, rather than exposing lower-level exception types directly.631632### Removed633634- The `request.url.origin` property and `httpx.Origin` class are no longer available.635- The per-request `cert`, `verify`, and `trust_env` arguments are escalated from raising errors if used, to no longer being available. These arguments should be used on a per-client instance instead, or in the top-level API.636- The `stream` argument has escalated from raising an error when used, to no longer being available. Use the `client.stream(...)` or `httpx.stream()` streaming API instead.637638### Fixed639640- Redirect loop detection matches against `(method, url)` rather than `url`. (Pull #734)641642---643644## 0.10.1 (December 31st, 2019)645646### Fixed647648- Fix issue with concurrent connection acquiry. (Pull #700)649- Fix write error on closing HTTP/2 connections. (Pull #699)650651## 0.10.0 (December 29th, 2019)652653The 0.10.0 release makes some changes that will allow us to support both sync and async interfaces.654655In particular with streaming responses the `response.read()` method becomes `response.aread()`, and the `response.close()` method becomes `response.aclose()`.656657If following redirects explicitly the `response.next()` method becomes `response.anext()`.658659### Fixed660661- End HTTP/2 streams immediately on no-body requests, rather than sending an empty body message. (Pull #682)662- Improve typing for `Response.request`: switch from `Optional[Request]` to `Request`. (Pull #666)663- `Response.elapsed` now reflects the entire download time. (Pull #687, #692)664665### Changed666667- Added `AsyncClient` as a synonym for `Client`. (Pull #680)668- Switch to `response.aread()` for conditionally reading streaming responses. (Pull #674)669- Switch to `response.aclose()` and `client.aclose()` for explicit closing. (Pull #674, #675)670- Switch to `response.anext()` for resolving the next redirect response. (Pull #676)671672### Removed673674- When using a client instance, the per-request usage of `verify`, `cert`, and `trust_env` have now escalated from raising a warning to raising an error. You should set these arguments on the client instead. (Pull #617)675- Removed the undocumented `request.read()`, since end users should not require it.676677---678679## 0.9.5 (December 20th, 2019)680681### Fixed682683- Fix Host header and HSTS rewrites when an explicit `:80` port is included in URL. (Pull #649)684- Query Params on the URL string are merged with any `params=...` argument. (Pull #653)685- More robust behavior when closing connections. (Pull #640)686- More robust behavior when handling HTTP/2 headers with trailing whitespace. (Pull #637)687- Allow any explicit `Content-Type` header to take precedence over the encoding default. (Pull #633)688689## 0.9.4 (December 12th, 2019)690691### Fixed692693- Added expiry to Keep-Alive connections, resolving issues with acquiring connections. (Pull #627)694- Increased flow control windows on HTTP/2, resolving download speed issues. (Pull #629)695696## 0.9.3 (December 7th, 2019)697698### Fixed699700- Fixed HTTP/2 with autodetection backend. (Pull #614)701702## 0.9.2 (December 7th, 2019)703704* Released due to packaging build artifact.705706## 0.9.1 (December 6th, 2019)707708* Released due to packaging build artifact.709710## 0.9.0 (December 6th, 2019)711712The 0.9 releases brings some major new features, including:713714* A new streaming API.715* Autodetection of either asyncio or trio.716* Nicer timeout configuration.717* HTTP/2 support off by default, but can be enabled.718719We've also removed all private types from the top-level package export.720721In order to ensure you are only ever working with public API you should make722sure to only import the top-level package eg. `import httpx`, rather than723importing modules within the package.724725### Added726727- Added concurrency backend autodetection. (Pull #585)728- Added `Client(backend='trio')` and `Client(backend='asyncio')` API. (Pull #585)729- Added `response.stream_lines()` API. (Pull #575)730- Added `response.is_error` API. (Pull #574)731- Added support for `timeout=Timeout(5.0, connect_timeout=60.0)` styles. (Pull #593)732733### Fixed734735- Requests or Clients with `timeout=None` now correctly always disable timeouts. (Pull #592)736- Request 'Authorization' headers now have priority over `.netrc` authentication info. (Commit 095b691)737- Files without a filename no longer set a Content-Type in multipart data. (Commit ed94950)738739### Changed740741- Added `httpx.stream()` API. Using `stream=True` now results in a warning. (Pull #600, #610)742- HTTP/2 support is switched to "off by default", but can be enabled explicitly. (Pull #584)743- Switched to `Client(http2=True)` API from `Client(http_versions=["HTTP/1.1", "HTTP/2"])`. (Pull #586)744- Removed all private types from the top-level package export. (Pull #608)745- The SSL configuration settings of `verify`, `cert`, and `trust_env` now raise warnings if used per-request when using a Client instance. They should always be set on the Client instance itself. (Pull #597)746- Use plain strings "TUNNEL_ONLY" or "FORWARD_ONLY" on the HTTPProxy `proxy_mode` argument. The `HTTPProxyMode` enum still exists, but its usage will raise warnings. (#610)747- Pool timeouts are now on the timeout configuration, not the pool limits configuration. (Pull #563)Fix typos (#1968)Kian Meng, Angbefore adoption82ba15b
line 748why, one step back748- The timeout configuration is now named `httpx.Timeout(...)`, not `httpx.TimeoutConfig(...)`. The old version currently remains as a synonym for backwards compatibility. (Pull #591)Update exceptions.md (#1432)Gerhard van Andelbefore adoption3c89b91
lines 749–876why, one step back749750---751752## 0.8.0 (November 27, 2019)753754### Removed755756- 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.)757758---759760## 0.7.8 (November 17, 2019)761762### Added763764- Add support for proxy tunnels for Python 3.6 + asyncio. (Pull #521)765766## 0.7.7 (November 15, 2019)767768### Fixed769770- Resolve an issue with cookies behavior on redirect requests. (Pull #529)771772### Added773774- Add request/response DEBUG logs. (Pull #502)775- Use TRACE log level for low level info. (Pull #500)776777## 0.7.6 (November 2, 2019)778779### Removed780781- Drop `proxies` parameter from the high-level API. (Pull #485)782783### Fixed784785- Tweak multipart files: omit null filenames, add support for `str` file contents. (Pull #482)786- Cache NETRC authentication per-client. (Pull #400)787- Rely on `getproxies` for all proxy environment variables. (Pull #470)788- Wait for the `asyncio` stream to close when closing a connection. (Pull #494)789790## 0.7.5 (October 10, 2019)791792### Added793794- Allow lists of values to be passed to `params`. (Pull #386)795- `ASGIDispatch`, `WSGIDispatch` are now available in the `httpx.dispatch` namespace. (Pull #407)796- `HTTPError` is now available in the `httpx` namespace. (Pull #421)797- Add support for `start_tls()` to the Trio concurrency backend. (Pull #467)798799### Fixed800801- Username and password are no longer included in the `Host` header when basic authentication802 credentials are supplied via the URL. (Pull #417)803804### Removed805806- The `.delete()` function no longer has `json`, `data`, or `files` parameters807 to match the expected semantics of the `DELETE` method. (Pull #408)808- Removed the `trio` extra. Trio support is detected automatically. (Pull #390)809810## 0.7.4 (September 25, 2019)811812### Added813814- Add Trio concurrency backend. (Pull #276)815- Add `params` parameter to `Client` for setting default query parameters. (Pull #372)816- Add support for `SSL_CERT_FILE` and `SSL_CERT_DIR` environment variables. (Pull #307)817- Add debug logging to calls into ASGI apps. (Pull #371)818- Add debug logging to SSL configuration. (Pull #378)819820### Fixed821822- Fix a bug when using `Client` without timeouts in Python 3.6. (Pull #383)823- Propagate `Client` configuration to HTTP proxies. (Pull #377)824825## 0.7.3 (September 20, 2019)826827### Added828829- HTTP Proxy support. (Pulls #259, #353)830- Add Digest authentication. (Pull #332)831- Add `.build_request()` method to `Client` and `AsyncClient`. (Pull #319)832- Add `.elapsed` property on responses. (Pull #351)833- Add support for `SSLKEYLOGFILE` in Python 3.8b4+. (Pull #301)834835### Removed836837- Drop NPN support for HTTP version negotiation. (Pull #314)838839### Fixed840841- Fix distribution of type annotations for mypy (Pull #361).842- Set `Host` header when redirecting cross-origin. (Pull #321)843- Drop `Content-Length` headers on `GET` redirects. (Pull #310)844- Raise `KeyError` if header isn't found in `Headers`. (Pull #324)845- Raise `NotRedirectResponse` in `response.next()` if there is no redirection to perform. (Pull #297)846- Fix bug in calculating the HTTP/2 maximum frame size. (Pull #153)847848## 0.7.2 (August 28, 2019)849850- Enforce using `httpx.AsyncioBackend` for the synchronous client. (Pull #232)851- `httpx.ConnectionPool` will properly release a dropped connection. (Pull #230)852- Remove the `raise_app_exceptions` argument from `Client`. (Pull #238)853- `DecodeError` will no longer be raised for an empty body encoded with Brotli. (Pull #237)854- Added `http_versions` parameter to `Client`. (Pull #250)855- Only use HTTP/1.1 on short-lived connections like `httpx.get()`. (Pull #284)856- Convert `Client.cookies` and `Client.headers` when set as a property. (Pull #274)857- Setting `HTTPX_DEBUG=1` enables debug logging on all requests. (Pull #277)858859## 0.7.1 (August 18, 2019)860861- Include files with source distribution to be installable. (Pull #233)862863## 0.7.0 (August 17, 2019)864865- Add the `trust_env` property to `BaseClient`. (Pull #187)866- Add the `links` property to `BaseResponse`. (Pull #211)867- Accept `ssl.SSLContext` instances into `SSLConfig(verify=...)`. (Pull #215)868- Add `Response.stream_text()` with incremental encoding detection. (Pull #183)869- Properly updated the `Host` header when a redirect changes the origin. (Pull #199)870- Ignore invalid `Content-Encoding` headers. (Pull #196)871- Use `~/.netrc` and `~/_netrc` files by default when `trust_env=True`. (Pull #189)872- Create exception base class `HTTPError` with `request` and `response` properties. (Pull #162)873- Add HSTS preload list checking within `BaseClient` to upgrade HTTP URLs to HTTPS. (Pull #184)874- Switch IDNA encoding from IDNA 2003 to IDNA 2008. (Pull #161)875- Expose base classes for alternate concurrency backends. (Pull #178)876- Improve Multipart parameter encoding. (Pull #167)Fix typos (#1968)Kian Meng, Angbefore adoption82ba15b
line 877why, one step back877- Add the `headers` property to `BaseClient`. (Pull #159)Update exceptions.md (#1432)Gerhard van Andelbefore adoption3c89b91
lines 878–927why, one step back878- Add support for Google's `brotli` library. (Pull #156)879- Remove deprecated TLS versions (TLSv1 and TLSv1.1) from default `SSLConfig`. (Pull #155)880- Fix `URL.join(...)` to work similarly to RFC 3986 URL joining. (Pull #144)881882---883884## 0.6.8 (July 25, 2019)885886- Check for disconnections when searching for an available887 connection in `ConnectionPool.keepalive_connections` (Pull #145)888- Allow string comparison for `URL` objects (Pull #139)889- Add HTTP status codes 418 and 451 (Pull #135)890- Add support for client certificate passwords (Pull #118)891- Enable post-handshake client cert authentication for TLSv1.3 (Pull #118)892- Disable using `commonName` for hostname checking for OpenSSL 1.1.0+ (Pull #118)893- Detect encoding for `Response.json()` (Pull #116)894895## 0.6.7 (July 8, 2019)896897- Check for connection aliveness on re-acquiry (Pull #111)898899## 0.6.6 (July 3, 2019)900901- Improve `USER_AGENT` (Pull #110)902- Add `Connection: keep-alive` by default to HTTP/1.1 connections. (Pull #110)903904## 0.6.5 (June 27, 2019)905906- Include `Host` header by default. (Pull #109)907- Improve HTTP protocol detection. (Pull #107)908909## 0.6.4 (June 25, 2019)910911- Implement read and write timeouts (Pull #104)912913## 0.6.3 (June 24, 2019)914915- Handle early connection closes (Pull #103)916917## 0.6.2 (June 23, 2019)918919- Use urllib3's `DEFAULT_CIPHERS` for the `SSLConfig` object. (Pull #100)920921## 0.6.1 (June 21, 2019)922923- Add support for setting a `base_url` on the `Client`.924925## 0.6.0 (June 21, 2019)926927- Honor `local_flow_control_window` for HTTP/2 connections (Pull #98)