Commit Graph

253 Commits

Author SHA1 Message Date
Fred Thomsen
5af6123fff
Update docs to reflect supported python versions (#2338)
Replaces Python 3.6 references with Python 3.7.

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-08-16 17:20:35 -05:00
Florimond Manca
93de1980fa
Expand docs about retries (#2311)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-07-29 13:21:58 +01:00
Ofek Lev
9884965233
Update link to trustme (#2318) 2022-07-25 17:23:08 +08:00
Florimond Manca
3a82176f1f
Rework docs structure (#2308) 2022-07-21 08:43:18 +02:00
Florimond Manca
943a942836
Fix link to "http2 explained" (#2307) 2022-07-18 14:34:06 +02:00
Daniel Holth
aad60a4f12
add [chunk_size] for a?iter_.* methods (#2281)
```
    def iter_bytes(
        self, chunk_size: typing.Optional[int] = None
    ) -> typing.Iterator[bytes]:
```
2022-06-24 14:36:45 +01:00
Tom Christie
1c33a2854e
Make charset auto-detection optional. (#2165)
* Add Response(..., default_encoding=...)

* Add tests for Response(..., default_encoding=...)

* Add Client(..., default_encoding=...)

* Switch default encoding to 'utf-8' instead of 'autodetect'

* Make charset_normalizer an optional dependancy, not a mandatory one.

* Documentation

* Use callable for default_encoding

* Update tests for new charset autodetection API

* Update docs for new charset autodetection API

* Update requirements

* Drop charset_normalizer from requirements
2022-05-23 16:27:32 +01:00
Kieran Klukas
940d61b239
Removed curio from async.md (#2240) 2022-05-23 11:09:15 +02:00
nyuszika7h
782f507b63
docs: Fix proxy examples (#2183)
Per https://www.python-httpx.org/compatibility/#proxy-keys, there should
always be a `://` after the protocol. The given examples raise an
exception when used as-is.

Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-05-05 13:11:18 +01:00
Ninzero
2b26412868
Clarify custom auth (#2202) 2022-05-04 11:11:53 +02:00
Johannes
781076cb63
Fix raise_for_status exception docs (#2159)
Closes #2126
2022-04-01 16:06:24 +01:00
Ofek Lev
67c297069f
Drop EOL Python 3.6 (#2097)
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-03-30 17:31:05 +02:00
Jorge
f7a024cee3
Corrected typo in advanced.md (#2155) 2022-03-30 16:58:00 +02:00
Dan Claudiu Pop
43a1c1c826
Add robox to third party packages doc (#2113)
* Add robox to third party packages doc

* Update third_party_packages.md
2022-03-08 10:53:15 +00:00
Ben Fasoli
6820b1d9c5
Fix invalid max_keepalive_connections argument name (#2094)
The argument to `httpx.Limits` is named `max_keepalive_connections` but is referenced as `max_keepalive` in the docs.
2022-02-25 14:10:35 +00:00
Udasi Tharani
2a08edc471
adding keepalive_expiry param to docs and docstring (#2090) 2022-02-22 10:40:14 +00:00
Tom Christie
2072aa2361
Docs tweaks (#2075) 2022-02-09 16:05:20 +00:00
iscai-msft
7d3a5347a9
update eerror docs to use StreamClosed instead of old ResponseClosed (#1913)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-02-09 11:53:49 +00:00
toppk
4f8068a7ad
update docstring/docs for transport using request/response models (#2070)
* update docstring/docs for transport based on pull #1840

* Update httpx/_transports/base.py

* lint'd

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-02-08 14:58:08 +00:00
Vytautas Liuolia
d299e6ff59
Do not recommend the deprecated data= kwarg for passing bytes. (#2044)
(`data=` is meant for sending form data.)
2022-01-23 21:37:27 +01:00
Tom Christie
8dc9b6bd59
SOCKS proxy support (#2034) 2022-01-19 14:58:19 +00:00
Denis Laxalde
3eaf69a772
Drop mention of backend selection for AsyncHTTPTransport() in docs (#2019)
There is no 'backend' parameter to AsyncHTTPTransport and it seems that
the backend is detected automatically for anyio as it is for other async
libraries.
2022-01-10 09:39:13 +00:00
Kian Meng, Ang
82ba15b521
Fix typos (#1968) 2021-12-14 15:04:01 +01:00
Tom Christie
b4f60694eb
Version 0.21 release notes (#1938) 2021-11-15 14:35:09 +00:00
Tyler Chamberlain
da8f959af0
Expand docs note for async custom handler responses (#1916)
* Expand note for async custom handler responses

Custom response handlers need to run `response.read()` before they can read the content of the response. However when using an AsyncClient this will produce an error of `RuntimeError: Attempted to call a sync iterator on an async stream.`. Took me some digging to figure out I just needed to use `response.aread()` here instead of `response.read()` so figured I would an MR with an expansion on the note for anyone else.
Thanks!

* Update advanced.md
2021-11-01 11:39:18 +00:00
Tom Christie
35164b7a64
Version 0.20 (#1890)
* Version 0.20

* Add date to changelog

* Freeze charset-normalizer to a known version for testing consistency
2021-10-13 10:43:58 +01:00
Marcelo Trylesinski
deb1a2b921
Update index.md (#1883)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-10-06 13:26:49 +01:00
Tom Christie
e1abaf146f
Tidy up the formatting of HTTP/2 requests (#1860)
* Tidy up the formatting of HTTP/2 requests

* Black linting
2021-09-14 13:36:22 +01:00
Tom Christie
7e01677f0a
List 'click' and 'rich' in the project dependencies (#1858) 2021-09-14 10:44:07 +01:00
Tom Christie
ee9250d60b
Add cli support (#1855)
* Add cli support

* Add setup.py

* Import main to 'httpx.main'

* Add 'cli' to requirements

* Add tests for command-line client

* Drop most CLI tests

* Add test_json

* Add test_redirects

* Coverage exclusion over _main.py in order to test more clearly

* Black formatting

* Add test_follow_redirects

* Add test_post, test_verbose, test_auth

* Add test_errors

* Remove test_errors

* Add test_download

* Change test_errors - perhaps the empty host header was causing the socket error?

* Update test_errors to not break socket

* Update docs

* Update version to 1.0.0.beta0

* Tweak CHANGELOG

* Fix up images in README

* Tweak images in README

* Update README
2021-09-14 09:44:43 +01:00
Tom Christie
47266d763b
Switch follow redirects default (#1808)
* Switch default on allow_redirects to False

* allow_redirects -> follow_redirects

* Update follow_redirects default in top-level API

* Update docs on follow_redirects
2021-09-13 13:21:22 +01:00
TAHRI Ahmed R
ecbece178f
📝 Docs patch following PR #1791 section compatibility.encoding (#1812)
* 📝 Docs patch following PR #1791 section compatibility.encoding

Reintroducing charset detection

* 📝 Amend sentence in 3080a9d66e

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-08-31 13:44:12 +01:00
Tom Christie
0d7c4caada
Version 0.19.0 (#1809)
* Update CHANGELOG

* Update CHANGELOG

* Version 0.19.0

* Update CHANGELOG
2021-08-19 12:37:25 +01:00
Tom Christie
2d9c3580e0
Switch event hooks to also run on redirects. (#1806)
* Switch event hooks to also run on redirects

* Bump coverage

* Add pragma: no cover, because sometime ya just gotta be pragmatic

* Update docs with note about response.read()
2021-08-18 15:12:39 +01:00
Tom Christie
d5143120d1
Use either brotli or brotlicffi. (#1618)
* Use either brotli (recommended for CPython) or brotlicffi (Recommended for PyPy and others)

* Add comments in places where we switch behaviour depending on brotli/brotlicffi

Co-authored-by: Florimond Manca <florimond.manca@gmail.com>
2021-08-13 11:52:45 +01:00
Tom Christie
acb5e6ac50
Add charset_normalizer detection. (#1791)
* Add charset_normalizer detection

* Tweak JSON tests for slightly different charset decoding behaviour

* Add charset-normalizer to docs
2021-08-13 11:38:53 +01:00
Florimond Manca
3d192aed45
Allow passing additional pytest args to scripts/test (#1710) 2021-06-24 11:15:59 +01:00
Sidharth Vinod
bb7f7dfda8
Add httpx-caching (#1694) 2021-06-17 13:30:33 +01:00
Vibhu Agarwal
f8cb7f5f02
[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>
2021-06-16 07:19:39 +02:00
Mei
604d09d7d7
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>
2021-06-16 07:04:47 +02:00
K900
776dbb578b
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
2021-05-21 10:30:30 +01:00
Jaakko Lappalainen
7025dd1952
fix typo in http2 section (#1632) 2021-05-09 00:49:14 +08:00
Vytautas Liuolia
2e4b308d7a
Make the MockTransport example more robust/correct (#1621) 2021-05-02 20:04:12 +02:00
Tom Christie
760af43b4f
Update brotli support to use the brotlicffi package (#1605)
* Update brotli support to use the brotlicffi package
2021-04-28 10:09:29 +01:00
Tom Christie
0c2cb240df
Version 0.18.0 (#1576)
* Version 0.18.0
2021-04-27 15:20:22 +01:00
Tom Christie
9b8f5af759
httpx.ResponseClosed -> httpx.StreamClosed (#1584)
* ResponseClosed -> StreamClosed

* Update docs for StreamClosed
2021-04-21 10:51:35 +01:00
Tom Christie
6a99f6f2b3
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>
2021-04-19 11:18:32 +01:00
Tom Christie
8fd5b71016
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
2021-04-19 11:07:07 +01:00
Tom Christie
397aad98fd
Escalate the distinction between data=... and content=... to be stricter (#1573) 2021-04-16 10:06:12 +01:00
Tom Christie
110ce85652
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>
2021-04-13 13:14:04 +01:00