Commit Graph

966 Commits

Author SHA1 Message Date
Tom Christie
da2a334f2d
Tweak issue config.yml (#1542)
* Update config.yml

* Update the issue template for neater formatting
2021-03-26 15:07:18 +00:00
Tom Christie
e65a33d3cf
Neater close logic (#1541) 2021-03-26 15:06:05 +00:00
Tom Christie
c26425aa58
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>
2021-03-26 12:54:04 +00:00
Tom Christie
c75ddc26c7
Fix Content-Length for unicode file contents with multipart (#1537) 2021-03-25 15:35:02 +00:00
Louis Maddox
68cf1ff88a
Fix typo to match library default (#1535)
Matches default given at https://github.com/encode/httpx/blob/master/httpx/_config.py#L359
2021-03-25 11:03:47 +00:00
Tom Christie
437b55c520
Refine project workflow (#1534)
* Refine project workflow

* Fix link to third party packages
2021-03-24 16:48:57 +00:00
Tom Christie
1a6e254f72
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>
2021-03-24 12:36:34 +00:00
Tom Christie
6cb1672459
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
2021-03-24 10:51:33 +00:00
laggardkernel
ea5ffce14f
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>
2021-03-21 15:59:31 +01:00
Tom Christie
e05a5372eb
Version 0.17.1 (#1505)
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2021-03-15 09:18:29 +00:00
Tom Christie
2e6930fd77
Version 0.17.1 (#1505) 2021-03-12 18:29:20 +00:00
Marat Sharafutdinov
24a55d73c3
Fix CertTypes (#1503) 2021-03-10 09:49:37 +00:00
Simon L
c09e61d50c
Incompatible with httpcore 0.12.0 (#1495) 2021-03-03 12:25:21 +01:00
Florimond Manca
06559f8266
Fix docs syntax highlighting (#1489) 2021-02-28 18:31:20 +01:00
Tom Christie
59f65e2b98
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>
2021-02-28 17:05:01 +01:00
Adam Hooper
0f280af8b1
map_exceptions in request.aclose() (#1465)
* map_exceptions in request.aclose()
2021-02-17 11:32:43 +00:00
Tom Christie
bd4caa873c
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
2021-02-17 11:27:10 +00:00
Tom Christie
084f35648b
Allow handler to optionally be async when MockTransport is used with AsyncClient (#1449) 2021-02-17 11:10:21 +00:00
Quentin Pradet
645ae4ed9c
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.
2021-02-17 10:11:08 +00:00
Quentin Pradet
5af6ab0038
Explain REQUESTS_CA_BUNDLE migration (#1471) 2021-02-17 10:06:28 +00:00
Aber
02a692aba5
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>
2021-02-16 13:33:17 +01:00
Adam Johnson
d964343fa1
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/
2021-02-09 15:10:42 +01:00
David Bordeynik
2847869475
fix-1457: URL's full_path -> raw_path from pull #1285 in docs as well (#1458) 2021-02-07 09:33:45 +01:00
Simon Willison
c52e7d212f
Added missing Request __init__ parameters (#1456)
Co-authored-by: Joe <nigelchiang@outlook.com>
2021-02-07 11:48:23 +08:00
Daniel Saxton
9542a17831
Fix doc capitalization (#1460) 2021-02-07 00:23:30 +01:00
Tom Christie
89fb0cbc69
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>
2021-01-08 10:23:56 +00:00
nkitsaini
181639322e
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>
2021-01-07 07:57:25 +01:00
Tom Christie
9c7c2ace99
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>
2021-01-06 11:04:26 +00:00
Konstantin
3bf18637c1
Remove double "then" in docs/http2.md (#1442) 2020-12-30 17:21:35 +01:00
Florimond Manca
25781a7625
Add troubleshooting guide, with initial proxies entries (#1435)
* Add troubleshooting guide, with initial proxies entries

* Drop unrelated issue
2020-12-29 13:40:53 +01:00
Florimond Manca
7f9bb5f32d
Remove stale reference to "Travis" (#1440) 2020-12-29 13:38:04 +01:00
shan7030
f4165e9e09
Add curio docs in Supported async environments (#1437)
Fixes: #1418
2020-12-25 16:57:14 +01:00
Colton Eakins
e3a7b6d731
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>
2020-12-23 20:09:43 +01:00
Gerhard van Andel
3c89b91d6b
Update exceptions.md (#1432) 2020-12-20 20:43:33 +01:00
SarunasAzna
86964054d6
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
2020-12-12 18:38:37 +01:00
Florimond Manca
584a40513f
Tweak advanced timeouts docs (#1420) 2020-12-08 14:31:00 +01:00
Florimond Manca
7ea6019c70
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>
2020-12-06 01:16:59 +01:00
Andrés Álvarez
28cbe77676
Add repr to Cookies for displaying available cookies (#1411)
* Add repr to Cookies for displaying available cookies

* Add unit test

* Simplify repr

* Remove file
2020-12-03 22:06:42 +01:00
Florimond Manca
9005bd5df6
Properly encoded slashes when using base_url (#1407) 2020-12-02 13:01:11 +00:00
Tom Christie
d0835da230
Add keepalive_expiry to Limits config (#1398)
* Add keepalive_expiry to Limits config

* keepalive_expiry should be optional. In line with httpcore.
2020-11-25 15:32:37 +00:00
Tom Christie
27df5e49c7
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>
2020-11-25 15:28:06 +00:00
Tom Christie
c4d2e6fa28
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
2020-11-24 10:35:51 +00:00
Tom Christie
2961f267fd
WSGI 'PATH_INFO' should be URL unquoted (#1391) 2020-11-16 09:39:51 +00:00
Tom Christie
0af6d9a254
Use relative links for interlinking markdown files in docs (#1390) 2020-11-13 15:03:30 +00:00
Tom Christie
16f41a2baa
Drop NBSP characters (#1389) 2020-11-13 12:38:03 +00:00
podhmo
f8f543057a
fix code example, in async.md (#1388) 2020-11-11 09:10:33 +00:00
Tom Christie
ceccb964e6
Update butterfly logo (#1382) 2020-11-10 10:16:07 +00:00
Kyungmin Lee
84dca25b8e
Fix typo (#1386)
* Fix typo

three greater-than signs -> three dots

* Fix typo

three greater-than signs -> three dots

* Fix typo

three greater-than signs -> three dots
2020-11-08 10:28:38 +01:00
plotski
589c6e0f2f
Include invalid name/value when raising TypeError in DataField (#1368) 2020-11-05 10:46:22 +00:00
Aber
1bc3b0188a
Add new project to Third Party Packages (#1364)
* Add new project to Third Party Packages

* Fix typo

Co-authored-by: Josep Cugat <jcugat@gmail.com>

* Update third-party-packages.md

Co-authored-by: Josep Cugat <jcugat@gmail.com>
Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2020-10-24 23:32:51 +02:00