Commit Graph

587 Commits

Author SHA1 Message Date
Iurii Pliner
b40c04dfa6
Drop support for Python 3.7 (#2813)
* Drop Python 3.7 support

* Fix lint

* Changelog
2023-08-09 10:02:28 +01:00
Trim21
9415af643f
Make raise_for_status chainable (#2776)
* merge upstream

* lint

* Update test_async_client.py

* update docs

* add example

* Update docs/quickstart.md

Co-authored-by: Tom Christie <tom@tomchristie.com>

* Update CHANGELOG.md

Co-authored-by: Tom Christie <tom@tomchristie.com>

* Update docs/quickstart.md

Co-authored-by: Tom Christie <tom@tomchristie.com>

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-08-01 10:22:58 +01:00
Zanie
18d7721c38
Use Mozilla documentation instead of httpstatuses.com for HTTP error reference (#2768) 2023-07-13 15:17:07 -05:00
Zanie Adkins
920333ea98
Always encode forward slashes as %2F in query parameters (#2723)
* Always encode forward slashes as `%2F` in query parameters

* Revert inclusion of "%"

This is expected to fail tests due to double escaping

* Update `urlencode`

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-06-09 10:06:56 +01:00
Nik
a682f6f1c7
Fix exception suppression in asgi transport (#2669) 2023-05-21 01:17:23 +01:00
Peter Lazorchak
abb994c0c2
Ensure all WSGITransport environs have a SERVER_PROTOCOL (#2708) 2023-05-19 11:38:18 +01:00
Tom Christie
ee432c0d30
Fix for gen-delims escaping behaviour in path/query/fragment (#2701) 2023-05-09 14:20:12 +01:00
Tom Christie
26dc39213a
Additional context in InvalidURL exceptions (#2675) 2023-04-20 12:17:44 +01:00
Florimond Manca
cca62060cb
Drop private imports from test_decoders.py (#2570)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-04-19 14:16:29 +01:00
Tom Christie
9ae170a936
Fix optional percent encoding behaviour. (#2671)
* Tests for failing optional percent encoding

* Linting

* Fix for optional percent escaping
2023-04-19 13:21:42 +01:00
Jiayun Shen
15d09a3bbc
fix: NO_PROXY should support IPv4, IPv6 and localhost (#2659)
* fix: NO_PROXY supports IPv4, IPv6 and localhost

* add more tests for test_get_environment_proxies

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-04-19 13:14:37 +01:00
Marcelo Trylesinski
daec2bdcdb
Use ruff instead of flake8, autoflake and isort (#2648)
* Use ruff instead of flake8, autoflake and isort

* Update pyproject.toml
2023-04-05 12:37:10 +02:00
Tom Christie
f1157dbc41
Use standard logging style (#2547)
* Use standard logging style

* Add docs for logging

* Drop out-of-date HTTPX_LOG_LEVEL variable docs
2023-03-20 11:30:11 +00:00
Gianni Tedesco
85c5898d8e
Change LineDecoder to match stdlib splitlines, resulting in significant speed up (#2423)
* Replace quadratic algo in LineDecoder

Leading to enormous speedups when doing things such as
Response(...).iter_lines() as described on issue #2422

* Update httpx/_decoders.py

* Update _decoders.py

Handle text ending in `\r` more gracefully.
Return as much content as possible.

* Update test_decoders.py

* Update _decoders.py

* Update _decoders.py

* Update _decoders.py

* Update httpx/_decoders.py

Co-authored-by: cdeler <serj.krotov@gmail.com>

* Update _decoders.py

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: cdeler <serj.krotov@gmail.com>
2023-03-16 14:29:15 +00:00
Florimond Manca
a934c36a85
Drop private imports from test_urlparse.py (#2572)
* Drop private imports from test_urlparse.py

* Coverage

* Drop ._uri_reference
2023-02-15 14:43:19 +00:00
Adrian Garcia Badaracco
f0fd91925b
fix type annotation for MockTransport (#2581)
* fix type annotation for MockTransport

* add type ignore

* better type checks

* better type checks

* add pragma

---------

Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-02-09 16:05:07 +00:00
Florimond Manca
18e0ae45ca
Drop private imports from test_exported_members.py (#2573)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-02-09 16:00:27 +00:00
Florimond Manca
ef06f7d076
Drop private imports in tests/conftest.py (#2569)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-02-09 15:54:53 +00:00
Florimond Manca
78d381fc7d
Drop private imports from test_main.py (#2574)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-02-09 15:50:09 +00:00
Florimond Manca
7488b15226
Drop private imports from test_exceptions.py (#2571) 2023-02-08 19:35:52 -05:00
Tom Christie
59914c7690
Add NetRCAuth() class. (#2535)
* NetRCAuth class

* Add docs for httpx.NetRCAuth()

* Drop failing cross-domain test for NetRCAuth()

* Update tests

* Update httpx/_auth.py

* Add tests for netrc file with no password
2023-01-12 11:27:46 +00:00
Tom Christie
7947b56076
Drop private import of 'encode_request' in test_multipart (#2525) 2023-01-10 11:23:14 +00:00
Tom Christie
a6af45edac
Use '%20' for encoding spaces in query parameters. (#2543)
* Add failing test

* Fix failing test case

* Add urlencode

* Update comment
2023-01-10 11:16:09 +00:00
Tom Christie
57daabf673
Drop rfc3986 requirement. (#2252)
* Drop RawURL

* First pass at adding urlparse

* Update urlparse

* Add urlparse

* Add urlparse

* Unicode non-printables can be valid in IDNA hostnames

* Update _urlparse.py docstring

* Linting

* Trim away ununsed codepaths

* Tweaks for path validation depending on scheme and authority presence

* Minor cleanups

* Minor cleanups

* full_path -> raw_path, forr internal consistency

* Linting fixes

* Drop rfc3986 dependency

* Add test for #1833

* Linting

* Drop 'rfc3986' dependancy from README and docs homepage

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2023-01-10 10:36:15 +00:00
Michael Adkins
bddd774ce0
Revert "Raise TypeError on invalid query params. (#2523)" (#2539)
This reverts commit 4cbf13ece2.
2023-01-04 09:23:32 +00:00
Thomas Grainger
e27d1b8333
replace pytest-asyncio and pytest-trio with anyio (#2512)
* replace pytest-asyncio with anyio

* remove pytest-trio also

* Update setup.cfg

* use anyio.Lock in test_auth

Co-authored-by: Tom Christie <tom@tomchristie.com>
2023-01-02 12:53:30 +00:00
Tom Christie
4cbf13ece2
Raise TypeError on invalid query params. (#2523)
* Raise TypeError on invalid query params

* Fix TypeError

* Update tests/models/test_queryparams.py

Co-authored-by: Michael Adkins <contact@zanie.dev>

* Linting

* Fix exception check

Co-authored-by: Michael Adkins <contact@zanie.dev>
2022-12-30 20:56:48 +00:00
Tom Christie
b82fbe2c13
Drop private import of 'format_form_param' from tests (#2500)
* Drop private import of 'format_form_param' from tests

* Drop unused code path
2022-12-12 16:31:29 +00:00
Tom Christie
b97c0594a5
Streaming multipart support (#2382)
* Streaming multipart support

* Update tests for streaming multipary
2022-12-12 16:14:56 +00:00
Tom Christie
af56476a8c
Drop unneccessary private import in tests (#2498) 2022-12-12 10:43:46 +00:00
Tom Christie
a8dd079be7
Raise TypeError if content is passed a 'dict' instance. (#2495) 2022-12-11 19:12:08 +00:00
Tom Christie
563a1031f5
Remove some private imports from test_decoders (#2496) 2022-12-06 18:22:04 +00:00
Tom Christie
71a1589928
Use httpx public API for 'test_content' tests (#2494) 2022-12-06 13:27:05 +00:00
Tom Christie
7985f685ca
Use consistent import style (#2493) 2022-12-06 11:58:30 +00:00
Demetri
40a0da093b
Add back in URL.raw with NamedTuple (#2481)
* add back in URL.raw with NamedTuple

* Update _urls.py

* Update _urls.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-12-02 16:20:05 +00:00
Martijn Pieters
933551c519
Typing: enable disallow_untyped_calls (#2479)
* Typing: enable disallow_untyped_calls

Only the test suite needed adjusting to add type hints.

* Update setup.cfg

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-12-02 10:47:42 +00:00
Martijn Pieters
884a69a902
Typing: enable strict_equality (#2480)
- ignore mypy when it comes to comparing an IntEnum member with an int
- Correct type hint for `test_wsgi_server_port`'s `expected_server_port`
  parameter.

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-12-02 08:45:28 +00:00
Martijn Pieters
57aa5b08a4
Enable no_implicit_reexport (#2475)
- Add explicit exports for names imported from `_compat`
- Correct imports of `URL` (from `._urls`, not via `._models`)
- Correct import of the uvicorn `Server` class

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-30 13:11:22 +00:00
Martijn Pieters
2d37321842
Typing: enable warn_return_any (#2477) 2022-11-30 13:08:02 +00:00
Martijn Pieters
049afe5b25
Typing: enable disallow_incomplete_defs (#2476)
The only places mypy reports issues is in the test suite.
2022-11-30 09:04:54 +00:00
rettier
8327e13454
reuse the digest auth state to avoid unnecessary requests (#2463)
* reuse the digest auth challenge to avoid sending twice as many requests

* fix for digest testcase

* ran testing/linting scripts

* codereview changes, removed tomchristie username from all authentication tests

Co-authored-by: Philipp Reitter <p.reitter@accessio.at>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 17:05:37 +00:00
Adrian Garcia Badaracco
69e13cbc39
Remove and dissallow unused type ignores (#2470)
* Remove and dissallow unused type ignores

* add pragmas

* fix ignore
2022-11-29 16:55:45 +00:00
Adrian Garcia Badaracco
1b4e7fbb48
Typing: always fill in generic type parameters (#2468)
* Typing: always fill in generic type parameters

Being explicit about the parameters helps find bugs and makes the library
easier to use for users.

- Tell mypy to disallow generics without parameter values
- Give all generic types parameters values

* fix things that aren't coming in from other commits

* lint

Co-authored-by: Martijn Pieters <mj@zopatista.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 16:36:03 +00:00
Adrian Garcia Badaracco
16e2830624
use # pragma: no cover instead of # pragma: nocover (#2471)
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-29 10:23:18 -06:00
Tom Christie
883cf8ca6f
Drop multipart requirement from tests (#2456) 2022-11-21 10:29:31 +00:00
Tom Christie
8752e2672c
Drop .read/.aread from SyncByteStream/AsyncByteStream (#2407) 2022-11-07 14:01:29 +00:00
Vincent Fazio
1aea9539bb
Drop cgi module from test_multipart (#2424)
* Use multipart instead of cgi for multipart tests

The cgi module has been deprecated as of python 3.11.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

* Update setup.cfg

All references to the cgi module have all been removed so there's no
longer a need to silence those deprecation warnings.

The deprecation warning for certifi is resolved as of version 2022.09.24.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-11-03 11:29:23 +00:00
Tom Christie
0ebe9259ac
Allow str content for multipart upload files (#2400) 2022-10-06 17:53:51 +01:00
Tom Christie
d5900cd40e
Fix empty query params (#2354)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-09-02 14:24:45 +01:00
Adrian Garcia Badaracco
1526048c94
allow setting an explicit multipart boundary via headers (#2278) 2022-08-15 10:20:07 -05:00
Tom Christie
9baf3a6cd2
Drop RawURL (#2241) 2022-05-30 14:54:47 +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
Alan Li
e9b0c85dd4
Patch copy_with (#2185)
* Patch `copy_with`

* Add a new test for `copy_with`
2022-05-03 11:33:13 +01:00
Tom Christie
3350d7e683
Close responses when on cancellations occur during reading. (#2156)
* Test case for clean stream closing on cancellations

* Test case for clean stream closing on cancellations

* Linting on tests

* responses should close on any BaseException
2022-03-31 13:41:40 +01:00
waterfountain1996
4c307488cd
Suppress binary output on the command line (#2049) (#2076) 2022-02-09 15:40:39 +00:00
waterfountain1996
4401d55ecf
Preserve Authorization header on HTTPS redirect (#1850) (#2074)
* Preserve Authorization header on HTTPS redirect (#1850)

* Update httpx/_client.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2022-02-09 11:18:21 +00:00
Tom Christie
420911bc69
Ensure that iter_bytes does not ever yield any zero-length chunks (#2068) 2022-02-07 09:19:26 +00:00
Tom Christie
0088253b32
Always rewind files on multipart uploads. (#2065)
* Test for multipart POST same file twice.

* Always rewind files on multipart uploads

* Linting
2022-02-04 14:48:57 +00:00
Adrian Garcia Badaracco
321d4aa509
Fix Headers.update to correctly handle repeated headers (#2038) 2022-01-21 08:35:10 -08:00
Tom Christie
8dc9b6bd59
SOCKS proxy support (#2034) 2022-01-19 14:58:19 +00:00
Tom Christie
7f0d43daad
Dont perform implicit close/warning on __del__ (#2026)
* Version 0.21.3

* Don't perform implict close on __del__
2022-01-13 10:37:37 +00:00
Adrian Garcia Badaracco
0f1ff50a1e
Allow custom headers in multipart/form-data requests (#1936)
* feat: allow passing multipart headers

* Add test for including content-type in headers

* lint

* override content_type with headers

* compare tuples based on length

* incorporate suggestion

* remove .title() on headers
2022-01-13 08:49:14 +00:00
Tom Christie
b7dc0c3df6
Fix for stream uploads that subclass SyncByteStream/AsyncByteStream (#2016) 2022-01-06 14:06:35 +00:00
Kian Meng, Ang
82ba15b521
Fix typos (#1968) 2021-12-14 15:04:01 +01:00
Tom Christie
6f5865f860
Read upload files using read(CHUNK_SIZE) rather than iter(). (#1948)
* Cap upload chunk sizes

* Use '.read' for file streaming, where possible

* Direct iteration should not apply chunk sizes
2021-11-22 13:15:39 +00:00
Tom Christie
61188feeae
Version 0.21 (#1935)
* Integrate with httpcore 0.14

* Fix pool timeout test

* Add request extensions to API

* Add certificate and connection info to client, using 'trace' extension

* Fix test_pool_timeout flakiness
2021-11-15 14:30:54 +00: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
a761e17abc
is_informational / is_success / is_redirect / is_client_error / is_server_error (#1854) 2021-09-13 13:52:58 +01:00
Tom Christie
ff9813e84d
Transport API as plain request -> response method. (#1840)
* Responses as context managers

* timeout -> request.extensions

* Transport API -> request/response signature

* Fix top-level httpx.stream()

* Drop response context manager methods

* Simplify ASGI tests

* Black formatting
2021-09-13 13:34:46 +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
Adrian Garcia Badaracco
0b4a83257b
BUG: wsgi.error should be TextIO, not BytesIO in WSGI transport (#1828)
* wsgi.error should be StringIO, not BytesIO

Based on the documentation at https://modwsgi.readthedocs.io/en/master/user-guides/debugging-techniques.html#apache-error-log-files

* Default to sys.stderr and add test

* rename log_file param to wsgi_errors

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-09-07 15:44:35 +01:00
Stanis Trendelenburg
0d3fcc74a5
Close WSGI iterable when WSGIByteStream is closed (#1830)
* Make test fail when WSGI iterable is not closed

* Close WSGI iterable when WSGIByteStream is closed
2021-09-01 16:21:01 +01:00
Tom Christie
10b60d47c7
Fix iter_bytes with empty content (#1827) 2021-08-31 11:52:52 +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
927c88d34f
Stricter enforcement of either 'with httpx.Client() as client' or 'client = httpx.Client()' lifespan styles. (#1800) 2021-08-13 15:17:15 +01:00
Antonio Larrosa
77193b2ab6
Add a network pytest mark for tests that use the network (#1669)
* Add a network pytest mark for tests that use the network

Sometimes it's useful to have the tests that use the network
marked so they can be skipped easily when we know the network
is not available.

This is useful for example on SUSE and openSUSE's build servers.
When building the httpx packages (actually, any package in the
distribution) the network is disabled so we can assure
reproducible builds (among other benefits). With this mark, it's
easier to skip tests that can not succeed.

* Add a better explanation for the network marker

Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>

Co-authored-by: Joe <nigelchiang@outlook.com>
Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-08-13 14:13:43 +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
Tom Christie
77246617ca
Drop mode argument, 'httpx.Proxy(..., mode=...)' (#1795) 2021-08-13 11:34:56 +01:00
Amin Alaee
20e66d2048
enforce-upload-files-binary-type (#1736)
* enforce-upload-files-binary-type

* Update test_multipart.py

Co-authored-by: Tom Christie <tom@tomchristie.com>
2021-08-13 11:27:42 +01:00
Michał Górny
ee24e67180
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.
2021-08-05 17:05:38 +01:00
Michał Górny
8c64e0c65f
Inline SERVER_SCOPE and remove typing_extensions requirement (#1773) 2021-07-26 15:08:58 +01:00
Almaz
b839478661
Replace for loops with comprehensions (#1759) 2021-07-21 14:30:55 +01:00
Tom Christie
b43af721cd
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>
2021-06-16 15:34:12 +01:00
Marcelo Trylesinski
3231211aa3
👷 Add Python 3.10 beta to the CI (#1682)
* 👷 Add Python 3.10 beta to the CI
* ⬆️ Upgrade pytest from 5.* to 6.*
2021-06-15 11:59:30 +01:00
Tom Christie
2129a9789a
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=...'
2021-04-30 10:40:42 +01: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
0a8b44e67d
Perform port normalization for http, https, ws, wss, and ftp schemes (#1603) 2021-04-27 14:06:23 +01:00
Tom Christie
e67b0dd15b
Expand URL interface (#1601)
* Expand URL interface

* Add URL query param manipulation methods
2021-04-27 09:01:14 +01:00
Tom Christie
2abb2f214a
Immutable QueryParams (#1600)
* Tweak QueryParams implementation

* Immutable QueryParams
2021-04-26 14:57:02 +01:00
Tom Christie
8fe32c52de
Tweak QueryParams implementation (#1598) 2021-04-26 14:06:12 +01:00
Tom Christie
6e55ca1af9
Escalate 0.17 deprecation warnings to becoming fully deprecated. (#1597) 2021-04-26 11:03:11 +01:00
Tom Christie
39d8ee619e
Differentiate between 'url.host' and 'url.raw_host' (#1590)
* Differentiate between 'url.host' and 'url.raw_host'
2021-04-23 11:00:53 +01:00
Tom Christie
d98e9e7ae7
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
2021-04-21 14:43:18 +01:00
Hannes Ljungberg
2d571046e1
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>
2021-04-21 11:11:00 +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
966550b342
For non-streaming cases, populate request.content automatically. (#1583)
* For non-streaming cases, populate request.content

* Linting
2021-04-19 11:13:45 +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
073a3284ab
Drop 'Response(on_close=...)' from API (#1572) 2021-04-16 10:03:37 +01:00