This adds support for zstd decoding using the python package zstandard.
This is similar to how it is implemented in urllib3. I also chose the
optional installation option httpx[zstd] to mimic the same option in
urllib3.
zstd decoding is similar to brotli, but in benchmarks it is supposed to
be even faster. The zstd compression is described in RFC 8878.
See https://github.com/encode/httpx/discussions/1986
Co-authored-by: Kamil Monicz <kamil@monicz.dev>
* replace pytest-asyncio with anyio
* remove pytest-trio also
* Update setup.cfg
* use anyio.Lock in test_auth
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Switch default on allow_redirects to False
* allow_redirects -> follow_redirects
* Update follow_redirects default in top-level API
* Update docs on follow_redirects
* Switch event hooks to also run on redirects
* Bump coverage
* Add pragma: no cover, because sometime ya just gotta be pragmatic
* Update docs with note about response.read()
* Add httpx.MockTransport
* Add docs on MockTransport
* Add pointer to RESPX
* Add note on pytest-httpx
* Tweak existing docs example to use 'httpx.MockTransport'
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Add EventHooks internal datastructure
* Add support for 'request' and 'response' event hooks
* Support Client.event_hooks property
* Handle exceptions raised by response event hooks
* Docs for event hooks
* Only support 'request' and 'response' event hooks
* Add event_hooks to top-level API
* Event hooks
* Formatting
* Formatting
* Fix up event hooks test
* Add test case to confirm that redirects/event hooks don't currently play together correctly
* Refactor test cases
* Make response.request clear in response event hooks docs
* Drop merge marker
* Request event hook runs as soon as we have an auth-constructed request