Commit Graph

109 Commits

Author SHA1 Message Date
Tom Christie
b9c8a1505e
Handle early connection closes (#103)
* Refactoring h11 implementation

* More h11 refactoring

* Support early connection closes on H11 connections

* Tweak comment

* Refactor concurrent read/writes

* Drop WriteTimeout masking

* Linting

* Use concurrent read/writes for HTTP2

* Push background sending into ConcurrencyBackend
2019-06-24 16:53:42 +01:00
updatatoday
f9e3ad4c16 Fixed response repr. (#101)
* Fixed response repr.

* Fixed response repr tests.
2019-06-23 11:37:00 +01:00
Tom Christie
9d5aaff5bc Support Client(base_url=...) 2019-06-21 15:03:01 +01:00
Tom Christie
bb8697011d
Support WSGI and ASGI apps. (#94)
* Add 'Client(app=...)' support

* Add ASGI support with Client(app=app)

* Improve exc cases when using client with ASGI

* Tighten up exception handling when using as a test client

* Fix up stream I/O for WSGI/ASGI apps

* Docs for WSGI/ASGI integration
2019-06-18 15:53:33 +01:00
Tom Christie
56a7943206
Int status codes (#92)
* Use plain int for response.status_code

* Linting
2019-06-17 16:53:39 +01:00
Tom Christie
6a44b05e4d
Multipart support (#90)
* Multipart support

* Test compat with 3.6
2019-06-17 14:38:24 +01:00
Tom Christie
7c6fb5c6ca
Tweaks (#89)
* Close redirect responses

* History should not be reverse-order

* History should not be reverse-order

* Docs updates
2019-06-13 16:19:39 +01:00
Tom Christie
c9747aa357
http3 (#86)
* Start fleshing out documentation

* Docs work

* http3

* Update docs

* Include lowercase status codes, for requests compat

* Updating docs

* Docs tweaks
2019-06-12 15:02:16 +01:00
Tom Christie
0cbf3c7581
Sync or Async dispatch (#83)
* Support thread-pooled dispatch

* Add ConcurrencyBackend.run

* Initial work towards support byte-iterators on sync request data

* Test case for byte iterator content

* byte iterator support for RequestData

* Add BaseResponse

* Bridge sync/async data in SyncResponse

* Add BaseClient

* SyncResponse -> Response

* Tweaking type annotation

* Distinct classes for Request, AsyncRequest

* Tweak is_streaming, content in BaseRequest

* Stream handling moves to client

* Handle mediating to AsyncResponse from a standard sync Dispatcher class

* Working on thread-pooled dispatcher

* Support threaded dispatch, inc. streaming requests/responses

* Increase test coverage

* Coverage and tweaks

* Include Accept and User-Agent headers by default
2019-06-10 12:26:03 +01:00
Tom Christie
76bc6c6dea
Drop Host header for HTTP/2 (#82) 2019-05-28 14:39:57 +01:00
Tom Christie
1970912c41 Drop unintended test module 2019-05-24 12:10:06 +01:00
Tom Christie
c12c271276
Status code tweaks (#77)
* Add top-level API

* Add tests for top-level API

* Further work towards parallel support

* StatusCode tweaks

* Drop erronous commit
2019-05-24 10:27:35 +01:00
Tom Christie
95740415db
Work on bringing API into parity with requests. (#76)
* Finesse timeout argument.

* Drop unused imports

* Add 'cert' and 'verify' arguments
2019-05-23 16:21:00 +01:00
Tom Christie
fc627f3387
Add top-level API (#75)
* Add top-level API

* Add tests for top-level API
2019-05-20 14:30:52 +01:00
Tom Christie
5a63d313f0 Add json interfaces 2019-05-17 14:43:22 +01:00
Tom Christie
2116d44777 Add response.json() 2019-05-17 14:29:36 +01:00
Tom Christie
a284d0b2ea Tweak test naming 2019-05-17 13:49:24 +01:00
Tom Christie
bb703771b3 query_params -> params 2019-05-17 13:09:31 +01:00
Tom Christie
c6287ed782 query_params -> params 2019-05-17 13:06:26 +01:00
Tom Christie
feae0a895d
Cookie support (#73)
* Initial pass at cookie support
* Add Cookies model
* Support cookie persistence
2019-05-17 12:51:00 +01:00
Tom Christie
f63148aa73 Support cookie persistence 2019-05-17 12:41:36 +01:00
Tom Christie
24b6923669 Add Cookies model 2019-05-17 11:45:02 +01:00
Tom Christie
1e0409c105 Add Cookies model 2019-05-17 10:00:56 +01:00
Tom Christie
4a3325f87b Initial pass at cookie support 2019-05-16 16:44:33 +01:00
Tom Christie
fc16d31d62
100% test coverage (#71) 2019-05-16 11:14:21 +01:00
Yeray Diaz Diaz
b8b3714d8e Add test for write timeout error (#67)
* Add test for write timeout error
* Bump up write data 10x
2019-05-16 11:00:45 +01:00
Tom Christie
3ed08857ee
Drop unused interface on ConnectionStore (#70) 2019-05-16 10:56:05 +01:00
Tom Christie
4fe6bc058a
Add 100-continue test (#68) 2019-05-16 10:21:24 +01:00
Tom Christie
5afa7dd5cc
Auth (#65)
* Initial work towards auth

* Add auth support

* Add test for custom auth

* Support auth-in-URL

* Support auth-on-session
2019-05-15 16:43:35 +01:00
Yeray Diaz Diaz
2e9ab2e904 Include URL.__hash__ in test (#64)
* Include URL.__hash__ in test

* Add test for URLs being used in a set

Remove hash assertion on test requests

* Cleanup models.py

* Use membership test instead of equality to avoid ordering problems
2019-05-15 14:30:00 +01:00
Tom Christie
abec2e85e9
Merge pull request #61 from yeraydiazdiaz/test-config
Test config
2019-05-14 14:36:37 +01:00
Tom Christie
8f4abe057b Linting 2019-05-14 14:35:55 +01:00
Tom Christie
73d5fca823 repr change: <SyncResponse ...> -> <Response ...> 2019-05-14 14:35:47 +01:00
Tom Christie
e40b0bfe83 Tidy up redirect tests 2019-05-14 14:34:43 +01:00
Tom Christie
3acc31621c Support alternate concurrency backends from client & rejig tests 2019-05-14 14:11:13 +01:00
Yeray Diaz Diaz
8d53257915 Add tests for config
Separate cert and key paths into its own fixture
2019-05-14 13:37:10 +01:00
Tom Christie
2694c48492 Add ConcurrencyBackend interface 2019-05-14 10:25:31 +01:00
Tom Christie
87cab4c5a4
Merge pull request #56 from yeraydiazdiaz/test-additional-http-methods
Additional tests for SyncClient
2019-05-14 09:33:34 +01:00
Tom Christie
c27c635f2f
Merge pull request #57 from yeraydiazdiaz/test-https
Add test to https server
2019-05-14 09:32:09 +01:00
Yeray Diaz Diaz
fe5a3b875b Add tests for additional HTTP methods on async client
Add tests for raise_for_status and SyncResponse properties
2019-05-13 21:01:13 +01:00
Yeray Diaz Diaz
e46ee49974 Rename test_asnyc_client > test_async_client 2019-05-13 20:41:50 +01:00
Yeray Diaz Diaz
b4ab7bb619 Additional tests for SyncClient 2019-05-13 20:39:24 +01:00
Yeray Diaz Diaz
b3af383923 Add test to https server
Add `https_server` test fixture
2019-05-13 20:33:16 +01:00
Tom Christie
3b4439039d Use stdlib status codes 2019-05-13 14:34:24 +01:00
Tom Christie
8627b62863 Switch to sync-by-default 2019-05-13 13:48:08 +01:00
Tom Christie
d6628ca88a Drop 'adapters' 2019-05-13 11:54:51 +01:00
Taoufik
a260d0ace8
Remove print 2019-05-08 17:31:06 +02:00
Tom Christie
e91c69d2ad Support url-encoded data in requests 2019-05-08 14:59:41 +01:00
Tom Christie
19542f2c3c Request(content=...) -> Request(data=...) 2019-05-08 14:45:06 +01:00
Tom Christie
e99ffbd7ac Increase test coverage 2019-05-08 13:52:26 +01:00