* 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>
* 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
* 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
* 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>
* Add support for async auth flows
* Move body logic to Auth, add sync_auth_flow, add NoAuth
* Update tests
* Stick to next() / __anext__()
* Fix undefined name errors
* Add docs
* Add unit tests for auth classes
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Drop urllib3 in favor of public gist
* Drop urllib3 coverage omit
* Drop recommendation to use urllib3 transport during Requests migration
* Add urllib3-transport to 3p pkgs
* Drop urllib3 from dependencies list in README / docs home page
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Adjust 1.0 expectations.
Not sure why I thought saying "expected September 2020" was a good idea.
Like *maybe* that'll happen, but no problem with us taking our time if there's areas we want to be really firm about first. *Eg finer details in the Transport API*.
* Update index.md
* Add AsyncClient.aclose to API documentation
* Expand client docstrings
* Add docstrings for all verbs and close methods
* Include parameter merge information and see also
* Update _client.py
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Version 0.14.0
* Update CHANGELOG
* Update CHANGELOG.md
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* Update CHANGELOG
* max_keepalive_connections
* Add deprecation test
* Update CHANGELOG.md
* Undate dependency pin callout
* Update expected 1.0 release date
Co-authored-by: Stephen Brown II <Stephen.Brown2@gmail.com>
* #1105 added deprecation warning, raised when we try to use proxies={"http": ...} instead of {"http://": ...}. Updated docs and added unit, which check the warning presence
* Update tests/client/test_proxies.py
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Update tests/client/test_proxies.py
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Included create_ssl_context function to create the same context with SSLConfig and serve as API.
* Changed create_ssl_context with SSLConfig into the client implementation and tests.
* Dropped the __repr__ and __eq__ methods from SSLConfig and removed SSLConfig using from tests
* Fixed test issue regarding cert_authority trust of ssl context
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* 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>
* Changed RequestFiles type
* Changed RequestFiles type 2
* Added test for multiple files same field
* Lint
* Mypy no idea
* Added doc
* Fixed some docs typos
* Checking the right instance type and deleting the mypy ignore
* Docs clarification
* Back on images form field, with other files modified
* 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>
* Version 0.13
* Update docs to 0.13 as the latest
* Whitespacing tweak
* More explicit notes about transport API renamings
* Update changelog
Co-authored-by: florimondmanca <florimond.manca@gmail.com>
* Pass proxy_url
* Rename hard_limit/soft_limit
* Use 'warn_deprecated' function
* Update PoolLimits docs
* Linting
* Update httpcore dependancy
* Update port in Transport API to be 'Optional[int]'
* Deprecate Client arg 'dispatch' and use 'transport'
* Remove line in test from coverage
* Document custom transports
* _dispatch > _transports
Also rename *Dispatch classes to *Transport and added aliases
* Fix linting issues
* Missed one _transports import
* Promote URLLib3Transport to public API
* Remove duplicate arg doc
* Assert that urllib3 is imported to use URLLib3Transport
* `AsyncClient`, not asynchronous `Client`
* Add warning category to warn calls
* Update docs/advanced.md
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Add warn_deprecated utility function
* Amend docs references to dispatch
* Add concrete implementation example
* Clearer transport implementation description
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Revamp docs on Client instances
* Apply suggestions from code review
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Reword 'Why use a Client?' section
* Apply suggestions from code review
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Add Auth.requires_response_body attribute
If set then responses are read by the client before being sent back into the auth flow
* Update tests and docs
* PR fixes
* Change example methods
* Detect auth in proxy URLs and create Proxy-authorization header
* Add credentials and SOCKS details to proxy documentation
* Use URL.copy_with to remove credentials from URL
* Version 0.10.0
* Update CHANGELOG.md
Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>
* Include changelog for 'response.request is no longer optional'.
* Add response.elapsed note to changelog
* Also ref original PR for response.elapsed behavior
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Changed behaviour of elapsed on response
* Fixed api docs for Response elapsed
* Minor tweaks to 'request.elapsed'
* Response instantiated with content should have elapsed==0
* Fix elapsed time on immediately closed responses.
* Drop nox in favor of vanilla scripts
* Use named stages
* Fix attrs dependency resolution madness
* Add missing mkautodoc dev dependency
* Add missing install step on windows build
* Explicitly define stage order so that timed out Windows build runs last
* Add missing dev dependency on Black
* Clean up contributing guide
* Separate docs into docs-build and docs-serve
* First pass at autodoc support
* Add mkautodoc requirement for docs builds
* Linting
* pip install httpx when building docs, to make it available to mkautodoc
* Fix code example in docstring slightly
* Use latest mkautodoc to resolve rendering of code snippets in docstrings
* Fill in 'Helper functions' API docs
* First pass at documenting Client
* Add autodoc for Client
* Update to mkautodoc 0.1
* Fix typos
* Drop `proxies` argument from high level API
* Update state of Digest auth in docs
* Add note on not supporting proxies at request level
* Grammar tweak
Co-Authored-By: Florimond Manca <florimond.manca@gmail.com>