There is no 'backend' parameter to AsyncHTTPTransport and it seems that
the backend is detected automatically for anyio as it is for other async
libraries.
* Expand note for async custom handler responses
Custom response handlers need to run `response.read()` before they can read the content of the response. However when using an AsyncClient this will produce an error of `RuntimeError: Attempted to call a sync iterator on an async stream.`. Took me some digging to figure out I just needed to use `response.aread()` here instead of `response.read()` so figured I would an MR with an expansion on the note for anyone else.
Thanks!
* Update advanced.md
* Add cli support
* Add setup.py
* Import main to 'httpx.main'
* Add 'cli' to requirements
* Add tests for command-line client
* Drop most CLI tests
* Add test_json
* Add test_redirects
* Coverage exclusion over _main.py in order to test more clearly
* Black formatting
* Add test_follow_redirects
* Add test_post, test_verbose, test_auth
* Add test_errors
* Remove test_errors
* Add test_download
* Change test_errors - perhaps the empty host header was causing the socket error?
* Update test_errors to not break socket
* Update docs
* Update version to 1.0.0.beta0
* Tweak CHANGELOG
* Fix up images in README
* Tweak images in README
* Update README
* 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()
* Use either brotli (recommended for CPython) or brotlicffi (Recommended for PyPy and others)
* Add comments in places where we switch behaviour depending on brotli/brotlicffi
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Adding netrc environment variable documentation
* Update docs/environment_variables.md
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Modifications about netrcfile environment variable
* Change uppercase "A" in netrcfile env variable into lowercase
* Added some words and a dot before "my_netrc" in the console example
* changed a typo "rather that" into "rather than" in advanced.md
* changed netrc environment variable in example part
* modified title for netrc environment variable part in doc
* Deleted the dot in title of netrc environment variable
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Deprecate per-request cookies
* Update docs/compatibility.md
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* Update httpx/_client.py
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* Update compatibility.md
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.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>
* Add keepalive_expiry to Limits config
* keepalive_expiry should be optional. In line with httpcore.
* HTTPTransport and AsyncHTTPTransport
* Update docs for httpx.HTTPTransport()
* Update type hints
* Fix docs typo
* Additional mount example
* Tweak context manager methods
* Add 'httpx.HTTPTransport(proxy=...)'
* Use explicit keyword arguments throughout httpx.HTTPTransport
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* 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>