Co-authored-by: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
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>
* Drop RawURL
* First pass at adding urlparse
* Update urlparse
* Add urlparse
* Add urlparse
* Unicode non-printables can be valid in IDNA hostnames
* Update _urlparse.py docstring
* Linting
* Trim away ununsed codepaths
* Tweaks for path validation depending on scheme and authority presence
* Minor cleanups
* Minor cleanups
* full_path -> raw_path, forr internal consistency
* Linting fixes
* Drop rfc3986 dependency
* Add test for #1833
* Linting
* Drop 'rfc3986' dependancy from README and docs homepage
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* 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>
* Added httpx.BaseTransport and httpx.AsyncBaseTransport
* Test coverage and default transports to calling .close on __exit__
* BaseTransport documentation
* Use 'handle_request' for the transport API.
* Docs tweaks
* Docs tweaks
* Minor docstring tweak
* Transport API docs
* Drop 'Optional' on Transport API
* Docs tweaks
* Tweak CHANGELOG
* Drop erronous example.py
* Push httpcore exception wrapping out of client into transport (#1524)
* Push httpcore exception wrapping out of client into transport
* Include close/aclose extensions in docstring
* Comment about the request property on RequestError exceptions
* Extensions reason_phrase and http_version as bytes (#1526)
* Extensions reason_phrase and http_version as bytes
* Update BaseTransport docstring
* Neaten up our try...except structure for ensuring responses (#1525)
* Fix CHANGELOG typo
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Fix CHANGELOG typo
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* stream: Iterator[bytes] -> stream: Iterable[bytes]
* Use proper bytestream interfaces when calling into httpcore
* Grungy typing workaround due to httpcore using Iterator instead of Iterable in bytestream types
* Update docs/advanced.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Consistent typing imports across tranports
* Update docs/advanced.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Fix HttpError -> HTTPError typo
* Increased test coverage
* Increase coverage threshold
* Reuse sync/async transport code in test_auth.py
* Removed close_client check inside StreamContextManager
It's never set as True when used in async
* Reuse sync/async transport code in test_redirects.py
* asgi: Wait for response to complete before sending disconnect message
* Dial back type checking + remove concurrency module
* Remove somewhat redundant comment
* Add 'Client(app=...)' support
* Add ASGI support with Client(app=app)
* Improve exc cases when using client with ASGI
* Tighten up exception handling when using as a test client
* Fix up stream I/O for WSGI/ASGI apps
* Docs for WSGI/ASGI integration