* Maybe port is `None`
https://www.python.org/dev/peps/pep-3333/#environ-variables
> SERVER_NAME, SERVER_PORT
> When HTTP_HOST is not set, these variables can be combined to determine a default. See the URL Reconstruction section below for more detail. SERVER_NAME and SERVER_PORT are required strings and must never be empty.
* Add unit test
* Compute default port
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>
* Updates compatibility guide to address event hooks
In `requests`, event hook callbacks can mutate response/request objects. In HTTPX, this is not the case.
Added text to address this difference, and added a link to the best alternate HTTPX offers in this circumstance.
More context:
https://github.com/encode/httpx/issues/1343#issuecomment-703223097
* Apply suggestions from code review
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Allow tuple as input of query parameters.
In the documentation it is stated that params can be dict, string or two
tuples. This allows to used two tuples. Previously it was possible to
use only tuple inside a list.
* tests for two tuples
* use isinstance to check the type of query params
* change list|tuple to in Sequence
* update documentation
* fix typing
* Support iter_raw(chunk_size=...) and aiter_raw(chunk_size=...)
* Unit tests for ByteChunker
* Support iter_bytes(chunk_size=...)
* Add TextChunker
* Support iter_text(chunk_size=...)
* Fix merge with master
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Add support for Mount API
* Add test cases
* Add test case for all: mounted transport
* Use 'transport' variable, in preference to 'proxy'
* Add docs for mounted transports