* Make Request and Response picklable
* fixup! Make Request and Response picklable
* Apply suggestions from code review
* Apply suggestions from code review
* Update tests/models/test_requests.py
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>
* 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>
* Support header comparisons with dict or list.
* Add check for no headers item
* Fixup testcases affected by headers comparison using dict or list
* Update test_responses.py
Co-authored-by: Tom Christie <tom@tomchristie.com>
* url.userinfo should be URL encoded bytes
* Neater copy_with implementation
* Finesse API around URL properties and copy_with
* Docstring for URL, and drop url.authority
* Support url.copy_with(raw_path=...)
* Docstrings on URL methods
* Tweak docstring
* Internal refactoring to swap auth/redirects ordering
* Drop chardet for charset detection
* Drop chardet in favour of simpler charset autodetection
* Revert unintentionally included changes
* Update test case
* Refactor to prefer different decoding style
* Update text decoding docs/docstrings
* Resolve typo
* Update docs/quickstart.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Prefer httpx.Client over httpx.AsyncClient in test cases, unless required.
* Prefer httpx.Client in test_headers
* Consistent httpx imports and httpx.Client usage
* Use 'import httpx' consistently in tests. Prefer httpx.Client.
* Drop private Origin model
* Drop Origin from docs
* Update tests/test_utils.py
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Drop full_path test
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
* Remove unused/untested headers copy() method
Last usage was removed in #804
* Remove unused premature_close server endpoint
Last usage was removed in #804
* Increased test coverage
* Revert removal of headers copy() method
Documented and added tests for it.
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>