]> git.ipfire.org Git - thirdparty/httpx.git/log
thirdparty/httpx.git
4 years agoenforce-upload-files-binary-type (#1736)
Amin Alaee [Fri, 13 Aug 2021 10:27:42 +0000 (14:57 +0430)] 
enforce-upload-files-binary-type (#1736)

* enforce-upload-files-binary-type

* Update test_multipart.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
4 years agoUpdate HTTP/2 support in `extras_require` (#1799)
Tom Christie [Fri, 13 Aug 2021 10:07:13 +0000 (11:07 +0100)] 
Update HTTP/2 support in `extras_require` (#1799)

* Update extras_require

* Update setup.py

4 years agoAdd Client(allow_redirect=<...>) (#1790)
Tom Christie [Tue, 10 Aug 2021 12:30:55 +0000 (13:30 +0100)] 
Add Client(allow_redirect=<...>) (#1790)

4 years agoFix JSON wrong encoding tests on big endian platforms (#1781)
Michał Górny [Thu, 5 Aug 2021 16:05:38 +0000 (18:05 +0200)] 
Fix JSON wrong encoding tests on big endian platforms (#1781)

Fix test_json_without_specified_encoding_*_error tests on big endian
platforms.  The tests wrongly assume that data encoded as "utf-32-be"
can not be decoded as "utf-32".  This is true on little endian platforms
but on big endian platforms "utf-32" is equivalent to "utf-32-be".
To avoid the problem, explicitly decode as "utf-32-le", as this should
trigger the expected exception independently of platform's endianness.

4 years agoInline SERVER_SCOPE and remove typing_extensions requirement (#1773)
Michał Górny [Mon, 26 Jul 2021 14:08:58 +0000 (16:08 +0200)] 
Inline SERVER_SCOPE and remove typing_extensions requirement (#1773)

4 years agoReplace for loops with comprehensions (#1759)
Almaz [Wed, 21 Jul 2021 13:30:55 +0000 (16:30 +0300)] 
Replace for loops with comprehensions (#1759)

4 years agoFix typo in wsgi.py (#1749)
Adrian Garcia Badaracco [Wed, 14 Jul 2021 09:08:21 +0000 (04:08 -0500)] 
Fix typo in wsgi.py (#1749)

4 years agocheck sys.version_info and ssl.OPENSSL_VERSION_INFO once (#1720)
Thomas Grainger [Mon, 28 Jun 2021 12:20:32 +0000 (13:20 +0100)] 
check sys.version_info and ssl.OPENSSL_VERSION_INFO once (#1720)

4 years agouse context.minimum_version in py3.7+ where available (#1714)
Thomas Grainger [Mon, 28 Jun 2021 12:12:30 +0000 (13:12 +0100)] 
use context.minimum_version in py3.7+ where available (#1714)

4 years agoAllow passing additional pytest args to scripts/test (#1710)
Florimond Manca [Thu, 24 Jun 2021 10:15:59 +0000 (12:15 +0200)] 
Allow passing additional pytest args to scripts/test (#1710)

4 years agoTest under Python 3.10b3 (#1707)
Joe [Tue, 22 Jun 2021 12:25:19 +0000 (20:25 +0800)] 
Test under Python 3.10b3 (#1707)

4 years agoAdd httpx-caching (#1694)
Sidharth Vinod [Thu, 17 Jun 2021 12:30:33 +0000 (18:00 +0530)] 
Add httpx-caching (#1694)

4 years agoFix third party documentation link (#1691)
Sidharth Vinod [Thu, 17 Jun 2021 10:37:03 +0000 (16:07 +0530)] 
Fix third party documentation link (#1691)

4 years agoVersion 0.18.2 (#1690) 0.18.2
Tom Christie [Thu, 17 Jun 2021 10:29:22 +0000 (11:29 +0100)] 
Version 0.18.2 (#1690)

* Version 0.18.2

4 years agoTreat warnings as errors (#1687)
Tom Christie [Wed, 16 Jun 2021 14:34:12 +0000 (15:34 +0100)] 
Treat warnings as errors (#1687)

* Treat warnings as errors

* Defensive programming in Client.__del__ to avoid possible warnings on partially initialized instances

* Linting

* Ignore linting getattr errors in __del__

* getattr requires a default

* Tighten up closing of auth_flow generators

* Switch multipart test to open file in a context manager

* Ignore warnings on uvicorn

* Drop -Werror from addopts

* Warings specified entirely in 'filterwarnings' section

* Use ssl.PROTOCOL_TLS_CLIENT instead of deprecated ssl.PROTOCOL_TLS

* Push 'check_hostname = False' above 'context.verify_mode = ssl.CERT_NONE'

* Introduce set_minimum_tls_version_1_2 compatible across different python versions

* Commenting

* Add missing annotation

* Exclude _compat from coverage

Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: jianghang <jianghang@didiglobal.com>
4 years agoFix typo (#1688)
laggardkernel [Wed, 16 Jun 2021 05:52:39 +0000 (13:52 +0800)] 
Fix typo (#1688)

4 years ago[Docs] Add AnyIO under "Supported async environments" (#1673)
Vibhu Agarwal [Wed, 16 Jun 2021 05:19:39 +0000 (10:49 +0530)] 
[Docs] Add AnyIO under "Supported async environments" (#1673)

* [Docs] Add AnyIO under "Supported async environments"

* Update docs/async.md

Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
4 years agoAdd netrc environment variable into the documentation (#1675)
Mei [Wed, 16 Jun 2021 05:04:47 +0000 (00:04 -0500)] 
Add netrc environment variable into the documentation (#1675)

* 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>
4 years ago👷 Add Python 3.10 beta to the CI (#1682)
Marcelo Trylesinski [Tue, 15 Jun 2021 10:59:30 +0000 (12:59 +0200)] 
👷 Add Python 3.10 beta to the CI (#1682)

* 👷 Add Python 3.10 beta to the CI
* ⬆️ Upgrade pytest from 5.* to 6.*

4 years agoUpdate PULL_REQUEST_TEMPLATE.md (#1681)
Marcelo Trylesinski [Mon, 14 Jun 2021 14:44:27 +0000 (16:44 +0200)] 
Update PULL_REQUEST_TEMPLATE.md (#1681)

Small typo on the PR template.

4 years ago➕ Add types-certifi to satisfy mypy 0.902 (#1679)
Marcelo Trylesinski [Mon, 14 Jun 2021 13:41:22 +0000 (15:41 +0200)] 
➕ Add types-certifi to satisfy mypy 0.902 (#1679)

4 years agodocs: slightly clarify event hooks (#1645)
K900 [Fri, 21 May 2021 09:30:30 +0000 (12:30 +0300)] 
docs: slightly clarify event hooks (#1645)

* Be more specific about when the hooks are called
* Explicitly mention and demonstrate that hooks are allowed to modify requests

See https://github.com/encode/httpx/discussions/1637

4 years agoSupport HTTP/2 prior-knowledge, using `httpx.Client(http1=False, http2=True)`. (...
bli74 [Tue, 11 May 2021 09:40:46 +0000 (11:40 +0200)] 
Support HTTP/2 prior-knowledge, using `httpx.Client(http1=False, http2=True)`. (#1624)

* Pass flag http1 to httpcore.

* Update httpcore version, reorder parameter list

Co-authored-by: ebertli <bert.lindemann@ericsson.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
4 years agoSwitch to `USE_CLIENT_DEFAULT` instead of `UNSET`. (#1634)
Tom Christie [Tue, 11 May 2021 09:25:01 +0000 (10:25 +0100)] 
Switch to `USE_CLIENT_DEFAULT` instead of `UNSET`. (#1634)

* Add failing test case for 'content=io.BytesIO(...)'

* Refactor peek_filelike_length to return an Optional[int]

* Peek filelength on file-like objects when rendering 'content=...'

* Switch to USE_CLIENT_DEFAULT

* Switch to USE_CLIENT_DEFAULT

* Linting

4 years agofix typo in http2 section (#1632)
Jaakko Lappalainen [Sat, 8 May 2021 16:49:14 +0000 (17:49 +0100)] 
fix typo in http2 section (#1632)

4 years agoMake the MockTransport example more robust/correct (#1621)
Vytautas Liuolia [Sun, 2 May 2021 18:04:12 +0000 (20:04 +0200)] 
Make the MockTransport example more robust/correct (#1621)

4 years agoPrefer `Content-Length` over `Transfer-Encoding: chunked` for `content=<file-like...
Tom Christie [Fri, 30 Apr 2021 09:40:42 +0000 (10:40 +0100)] 
Prefer `Content-Length` over `Transfer-Encoding: chunked` for `content=<file-like>` cases. (#1619)

* Add failing test case for 'content=io.BytesIO(...)'

* Refactor peek_filelike_length to return an Optional[int]

* Peek filelength on file-like objects when rendering 'content=...'

4 years agoVersion 0.18.1 (#1617) 0.18.1
Tom Christie [Thu, 29 Apr 2021 12:57:12 +0000 (13:57 +0100)] 
Version 0.18.1 (#1617)

* Version 0.18.1

* Update CHANGELOG.md

4 years agoMap `httpcore` transport close exceptions to `httpx` exceptions. (#1606)
Tom Christie [Thu, 29 Apr 2021 11:37:37 +0000 (12:37 +0100)] 
Map `httpcore` transport close exceptions to `httpx` exceptions. (#1606)

4 years agoAdd missing timeout=... to top-level httpx.stream() function. (#1613)
Tom Christie [Thu, 29 Apr 2021 10:08:48 +0000 (11:08 +0100)] 
Add missing timeout=... to top-level httpx.stream() function. (#1613)

4 years agoStream tweak (#1607)
Tom Christie [Wed, 28 Apr 2021 19:39:11 +0000 (20:39 +0100)] 
Stream tweak (#1607)

4 years agoUpdate brotli support to use the brotlicffi package (#1605)
Tom Christie [Wed, 28 Apr 2021 09:09:29 +0000 (10:09 +0100)] 
Update brotli support to use the brotlicffi package (#1605)

* Update brotli support to use the brotlicffi package

4 years agoVersion 0.18.0 (#1576) 0.18.0
Tom Christie [Tue, 27 Apr 2021 14:20:22 +0000 (15:20 +0100)] 
Version 0.18.0 (#1576)

* Version 0.18.0

4 years agoPerform port normalization for http, https, ws, wss, and ftp schemes (#1603)
Tom Christie [Tue, 27 Apr 2021 13:06:23 +0000 (14:06 +0100)] 
Perform port normalization for http, https, ws, wss, and ftp schemes (#1603)

4 years agoCode comments for URL model (#1602)
Tom Christie [Tue, 27 Apr 2021 10:23:52 +0000 (11:23 +0100)] 
Code comments for URL model (#1602)

4 years agoExpand URL interface (#1601)
Tom Christie [Tue, 27 Apr 2021 08:01:14 +0000 (09:01 +0100)] 
Expand URL interface (#1601)

* Expand URL interface

* Add URL query param manipulation methods

4 years agoImmutable QueryParams (#1600)
Tom Christie [Mon, 26 Apr 2021 13:57:02 +0000 (14:57 +0100)] 
Immutable QueryParams (#1600)

* Tweak QueryParams implementation

* Immutable QueryParams

4 years agoTweak QueryParams implementation (#1598)
Tom Christie [Mon, 26 Apr 2021 13:06:12 +0000 (14:06 +0100)] 
Tweak QueryParams implementation (#1598)

4 years agoEscalate 0.17 deprecation warnings to becoming fully deprecated. (#1597)
Tom Christie [Mon, 26 Apr 2021 10:03:11 +0000 (11:03 +0100)] 
Escalate 0.17 deprecation warnings to becoming fully deprecated. (#1597)

4 years agoDifferentiate between 'url.host' and 'url.raw_host' (#1590)
Tom Christie [Fri, 23 Apr 2021 10:00:53 +0000 (11:00 +0100)] 
Differentiate between 'url.host' and 'url.raw_host' (#1590)

* Differentiate between 'url.host' and 'url.raw_host'

4 years agoSupport HTTPCore 0.13 (#1588)
Tom Christie [Wed, 21 Apr 2021 13:43:18 +0000 (14:43 +0100)] 
Support HTTPCore 0.13 (#1588)

* Support HTTPCore 0.13

* Update httpcore minimum version

* Call into 'handle_async_request', not 'arequest'

* Drop unintentional commit

* Update tests

4 years agoMake Request and Response picklable (#1579)
Hannes Ljungberg [Wed, 21 Apr 2021 10:11:00 +0000 (12:11 +0200)] 
Make Request and Response picklable (#1579)

* 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>
4 years ago`httpx.ResponseClosed` -> `httpx.StreamClosed` (#1584)
Tom Christie [Wed, 21 Apr 2021 09:51:35 +0000 (10:51 +0100)] 
`httpx.ResponseClosed` -> `httpx.StreamClosed` (#1584)

* ResponseClosed -> StreamClosed

* Update docs for StreamClosed

4 years agoDeprecate per-request cookies (#1574)
Tom Christie [Mon, 19 Apr 2021 10:18:32 +0000 (11:18 +0100)] 
Deprecate per-request cookies (#1574)

* 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>
4 years agoFor non-streaming cases, populate `request.content` automatically. (#1583)
Tom Christie [Mon, 19 Apr 2021 10:13:45 +0000 (11:13 +0100)] 
For non-streaming cases, populate `request.content` automatically. (#1583)

* For non-streaming cases, populate request.content

* Linting

4 years agoDrop StreamContextManager in favour of `contextlib.contextmanager`/`asynccontextmanag...
Tom Christie [Mon, 19 Apr 2021 10:07:07 +0000 (11:07 +0100)] 
Drop StreamContextManager in favour of `contextlib.contextmanager`/`asynccontextmanager` (#1577)

* Drop StreamContextManager in favour of using contextlib.contextmanager/asyncontextmanager

* Use type: ignore to avoid mypy errors on 3.6

4 years agoDrop Response.call_next leftover attribute (#1578)
Hannes Ljungberg [Fri, 16 Apr 2021 19:05:34 +0000 (21:05 +0200)] 
Drop Response.call_next leftover attribute (#1578)

4 years agoEscalate the distinction between data=... and content=... to be stricter (#1573)
Tom Christie [Fri, 16 Apr 2021 09:06:12 +0000 (10:06 +0100)] 
Escalate the distinction between data=... and content=... to be stricter (#1573)

4 years agoDrop 'Response(on_close=...)' from API (#1572)
Tom Christie [Fri, 16 Apr 2021 09:03:37 +0000 (10:03 +0100)] 
Drop 'Response(on_close=...)' from API (#1572)

4 years agoUpdate `verify` parameter description (#1575)
ascopes [Fri, 16 Apr 2021 09:03:08 +0000 (10:03 +0100)] 
Update `verify` parameter description (#1575)

Included that the verify parameter can be an SSL context, as it currently is missing information
that is present in the advanced usage section of the documentation, and the type hints are not
showing up in the interface specification.

Amend verify docs for client

4 years agoStream interface (#1550)
Tom Christie [Tue, 13 Apr 2021 12:14:04 +0000 (13:14 +0100)] 
Stream interface (#1550)

* Add SyncByteStream, AsyncByteStream to interface

* request.stream and response.stream as httpx.SyncByteStream/httpx.AsyncByteStream

* Update httpx/_transports/base.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Update httpx/_transports/default.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
* Move response classes in transports to module level

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
4 years agoAdded docs for using client-side ssl certificates (#1570)
Hemanth kumar [Tue, 13 Apr 2021 12:08:22 +0000 (17:38 +0530)] 
Added docs for using client-side ssl certificates (#1570)

* Added docs for using client-side ssl certificates

* Update docs/advanced.md

Co-authored-by: Joe <nigelchiang@outlook.com>
* Update docs/advanced.md

Co-authored-by: Joe <nigelchiang@outlook.com>
* Update docs/advanced.md

* Update docs/advanced.md

* Update docs/advanced.md

Co-authored-by: Hemanth <hemanth@actionfi.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Joe <nigelchiang@outlook.com>
4 years agoFix up license whitespacing (#1563)
Tom Christie [Fri, 9 Apr 2021 12:08:34 +0000 (13:08 +0100)] 
Fix up license whitespacing (#1563)

4 years agoAdd httpx-auth and pytest-httpx to third party documentation (#1560)
Colin Bounouar [Wed, 7 Apr 2021 21:02:44 +0000 (23:02 +0200)] 
Add httpx-auth and pytest-httpx to third party documentation (#1560)

4 years agoadded docs for startup/shutdown of ASGI apps (#1554)
Jaakko Lappalainen [Mon, 5 Apr 2021 08:55:57 +0000 (09:55 +0100)] 
added docs for startup/shutdown of ASGI apps (#1554)

4 years agoFix extenstions typo in AsyncHTTPTransport (#1549)
Jonas Lundberg [Thu, 1 Apr 2021 14:32:20 +0000 (16:32 +0200)] 
Fix extenstions typo in AsyncHTTPTransport (#1549)

4 years agoTweak issue config.yml (#1542)
Tom Christie [Fri, 26 Mar 2021 15:07:18 +0000 (15:07 +0000)] 
Tweak issue config.yml (#1542)

* Update config.yml

* Update the issue template for neater formatting

4 years agoNeater close logic (#1541)
Tom Christie [Fri, 26 Mar 2021 15:06:05 +0000 (15:06 +0000)] 
Neater close logic (#1541)

4 years agoHandle `data={"key": [None|int|float|bool]}` cases. (#1539)
Tom Christie [Fri, 26 Mar 2021 12:54:04 +0000 (12:54 +0000)] 
Handle `data={"key": [None|int|float|bool]}` cases. (#1539)

* Fix Content-Length for unicode file contents with multipart

* Handle bool and None cases for URLEncoded data

* Handle int, float, bool, and None for multipart or urlencoded data

* Update httpx/_utils.py

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
4 years agoFix Content-Length for unicode file contents with multipart (#1537)
Tom Christie [Thu, 25 Mar 2021 15:35:02 +0000 (15:35 +0000)] 
Fix Content-Length for unicode file contents with multipart (#1537)

4 years agoFix typo to match library default (#1535)
Louis Maddox [Thu, 25 Mar 2021 11:03:47 +0000 (11:03 +0000)] 
Fix typo to match library default (#1535)

Matches default given at https://github.com/encode/httpx/blob/master/httpx/_config.py#L359

4 years agoRefine project workflow (#1534)
Tom Christie [Wed, 24 Mar 2021 16:48:57 +0000 (16:48 +0000)] 
Refine project workflow (#1534)

* Refine project workflow

* Fix link to third party packages

4 years agoTransport API (#1522)
Tom Christie [Wed, 24 Mar 2021 12:36:34 +0000 (12:36 +0000)] 
Transport API (#1522)

* 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>
4 years agoFix some cases of merging with base_url (#1532)
Tom Christie [Wed, 24 Mar 2021 10:51:33 +0000 (10:51 +0000)] 
Fix some cases of merging with base_url (#1532)

* Fix some cases of merging with base_url

* Fix for joining relative URLs

* Improve code comment in _merge_url implementation

4 years agoFix redirect description about HEAD (#1520)
laggardkernel [Sun, 21 Mar 2021 14:59:31 +0000 (22:59 +0800)] 
Fix redirect description about HEAD (#1520)

* Fix redirect description about HEAD

* Apply suggestions from code review

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
4 years agoVersion 0.17.1 (#1505) 0.17.1
Tom Christie [Mon, 15 Mar 2021 09:18:29 +0000 (09:18 +0000)] 
Version 0.17.1 (#1505)

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
4 years agoVersion 0.17.1 (#1505)
Tom Christie [Fri, 12 Mar 2021 18:29:20 +0000 (18:29 +0000)] 
Version 0.17.1 (#1505)

4 years agoFix CertTypes (#1503)
Marat Sharafutdinov [Wed, 10 Mar 2021 09:49:37 +0000 (12:49 +0300)] 
Fix CertTypes (#1503)

4 years agoIncompatible with httpcore 0.12.0 (#1495)
Simon L [Wed, 3 Mar 2021 11:25:21 +0000 (12:25 +0100)] 
Incompatible with httpcore 0.12.0 (#1495)

4 years agoFix docs syntax highlighting (#1489)
Florimond Manca [Sun, 28 Feb 2021 17:31:20 +0000 (18:31 +0100)] 
Fix docs syntax highlighting (#1489)

4 years agoVersion 0.17.0 (#1403) 0.17.0
Tom Christie [Sun, 28 Feb 2021 16:05:01 +0000 (16:05 +0000)] 
Version 0.17.0 (#1403)

* Version 0.17.0

* Update changelog

* Tweak verbs

* Fix backtick

Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>
5 years agomap_exceptions in request.aclose() (#1465)
Adam Hooper [Wed, 17 Feb 2021 11:32:43 +0000 (06:32 -0500)] 
map_exceptions in request.aclose() (#1465)

* map_exceptions in request.aclose()

5 years agoTweak `create_ssl_context` defaults. (#1447)
Tom Christie [Wed, 17 Feb 2021 11:27:10 +0000 (11:27 +0000)] 
Tweak `create_ssl_context` defaults. (#1447)

* Version 0.17.0

* create_ssl_config uses trust_env=True default

* Drop CHANGELOG notes, to be included in a version PR instead

5 years agoAllow handler to optionally be async when MockTransport is used with AsyncClient...
Tom Christie [Wed, 17 Feb 2021 11:10:21 +0000 (11:10 +0000)] 
Allow handler to optionally be async when MockTransport is used with AsyncClient (#1449)

5 years agoExplain SSL_CERT_DIR specific format (#1470)
Quentin Pradet [Wed, 17 Feb 2021 10:11:08 +0000 (14:11 +0400)] 
Explain SSL_CERT_DIR specific format (#1470)

It's easy to believe that any .pem files there will get picked up automatically, but that's not the case.

5 years agoExplain REQUESTS_CA_BUNDLE migration (#1471)
Quentin Pradet [Wed, 17 Feb 2021 10:06:28 +0000 (14:06 +0400)] 
Explain REQUESTS_CA_BUNDLE migration (#1471)

5 years agoHandle default ports in WSGITransport (#1469)
Aber [Tue, 16 Feb 2021 12:33:17 +0000 (20:33 +0800)] 
Handle default ports in WSGITransport (#1469)

* 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>
5 years agoAdd Changelog link to PyPI page (#1462)
Adam Johnson [Tue, 9 Feb 2021 14:10:42 +0000 (14:10 +0000)] 
Add Changelog link to PyPI page (#1462)

Makes it easy to find out about changes, and it gets a little "present" icon, for example https://pypi.org/project/django-linear-migrations/

5 years agofix-1457: URL's full_path -> raw_path from pull #1285 in docs as well (#1458)
David Bordeynik [Sun, 7 Feb 2021 08:33:45 +0000 (10:33 +0200)] 
fix-1457: URL's full_path -> raw_path from pull #1285 in docs as well (#1458)

5 years agoAdded missing Request __init__ parameters (#1456)
Simon Willison [Sun, 7 Feb 2021 03:48:23 +0000 (19:48 -0800)] 
Added missing Request __init__ parameters (#1456)

Co-authored-by: Joe <nigelchiang@outlook.com>
5 years agoFix doc capitalization (#1460)
Daniel Saxton [Sat, 6 Feb 2021 23:23:30 +0000 (17:23 -0600)] 
Fix doc capitalization (#1460)

5 years agoAdd `HTTPTransport` and `AsyncHTTPTransport` (#1399)
Tom Christie [Fri, 8 Jan 2021 10:23:56 +0000 (10:23 +0000)] 
Add `HTTPTransport` and `AsyncHTTPTransport` (#1399)

* 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>
5 years agoUpdate README to reflect new estimate for v1.0 release (#1445)
nkitsaini [Thu, 7 Jan 2021 06:57:25 +0000 (12:27 +0530)] 
Update README to reflect new estimate for v1.0 release (#1445)

Co-authored-by: Ankit <ankit@jpqr.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
5 years agoAdd `httpx.MockTransport()` (#1401)
Tom Christie [Wed, 6 Jan 2021 11:04:26 +0000 (11:04 +0000)] 
Add `httpx.MockTransport()` (#1401)

* 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>
5 years agoRemove double "then" in docs/http2.md (#1442)
Konstantin [Wed, 30 Dec 2020 16:21:35 +0000 (17:21 +0100)] 
Remove double "then" in docs/http2.md (#1442)

5 years agoAdd troubleshooting guide, with initial proxies entries (#1435)
Florimond Manca [Tue, 29 Dec 2020 12:40:53 +0000 (13:40 +0100)] 
Add troubleshooting guide, with initial proxies entries (#1435)

* Add troubleshooting guide, with initial proxies entries

* Drop unrelated issue

5 years agoRemove stale reference to "Travis" (#1440)
Florimond Manca [Tue, 29 Dec 2020 12:38:04 +0000 (13:38 +0100)] 
Remove stale reference to "Travis" (#1440)

5 years agoAdd curio docs in Supported async environments (#1437)
shan7030 [Fri, 25 Dec 2020 15:57:14 +0000 (21:27 +0530)] 
Add curio docs in Supported async environments (#1437)

Fixes: #1418
5 years agoUpdates compatibility guide to address event hooks (#1436)
Colton Eakins [Wed, 23 Dec 2020 19:09:43 +0000 (13:09 -0600)] 
Updates compatibility guide to address event hooks (#1436)

* 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>
5 years agoUpdate exceptions.md (#1432)
Gerhard van Andel [Sun, 20 Dec 2020 19:43:33 +0000 (19:43 +0000)] 
Update exceptions.md (#1432)

5 years agoAllow tuple as input of query parameters. (#1426)
SarunasAzna [Sat, 12 Dec 2020 17:38:37 +0000 (18:38 +0100)] 
Allow tuple as input of query parameters. (#1426)

* 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

5 years agoTweak advanced timeouts docs (#1420)
Florimond Manca [Tue, 8 Dec 2020 13:31:00 +0000 (14:31 +0100)] 
Tweak advanced timeouts docs (#1420)

5 years agoDocument content encoding differences with Requests (#1416)
Florimond Manca [Sun, 6 Dec 2020 00:16:59 +0000 (01:16 +0100)] 
Document content encoding differences with Requests (#1416)

* Document content encoding differences with Requests

* Apply suggestions from code review

* Tweak copy for Windows-1252

Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>
Co-authored-by: Jamie Hewland <jamie.hewland@hpe.com>
5 years agoAdd repr to Cookies for displaying available cookies (#1411)
Andrés Álvarez [Thu, 3 Dec 2020 21:06:42 +0000 (15:06 -0600)] 
Add repr to Cookies for displaying available cookies (#1411)

* Add repr to Cookies for displaying available cookies

* Add unit test

* Simplify repr

* Remove file

5 years agoProperly encoded slashes when using `base_url` (#1407)
Florimond Manca [Wed, 2 Dec 2020 13:01:11 +0000 (14:01 +0100)] 
Properly encoded slashes when using `base_url` (#1407)

5 years agoAdd keepalive_expiry to Limits config (#1398)
Tom Christie [Wed, 25 Nov 2020 15:32:37 +0000 (15:32 +0000)] 
Add keepalive_expiry to Limits config (#1398)

* Add keepalive_expiry to Limits config

* keepalive_expiry should be optional. In line with httpcore.

5 years agoSupport for `chunk_size` (#1277)
Tom Christie [Wed, 25 Nov 2020 15:28:06 +0000 (15:28 +0000)] 
Support for `chunk_size` (#1277)

* 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>
5 years agoAdd support for Mount API (#1362)
Tom Christie [Tue, 24 Nov 2020 10:35:51 +0000 (10:35 +0000)] 
Add support for Mount API (#1362)

* 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

5 years agoWSGI 'PATH_INFO' should be URL unquoted (#1391)
Tom Christie [Mon, 16 Nov 2020 09:39:51 +0000 (09:39 +0000)] 
WSGI 'PATH_INFO' should be URL unquoted (#1391)

5 years agoUse relative links for interlinking markdown files in docs (#1390)
Tom Christie [Fri, 13 Nov 2020 15:03:30 +0000 (15:03 +0000)] 
Use relative links for interlinking markdown files in docs (#1390)