Commit Graph

704 Commits

Author SHA1 Message Date
Sean McArthur
53495e1526 Redesign Error type
- The `Error`'s kind is a now a set of variants depending on the context
  of when an error could occur.
- If another error was the cause, it is now always the `source`.

Along with the `is_*` methods, this should help in understanding *when*
a certain error occurred. For example, an error setting the TLS
certificates will return a builder error, with the TLS error as the
source. This should help differentiate from a TLS error that happens
when connecting to a server.

It also makes the internal code less dependent on all the exact
dependencies that can be enabled or disabled.
2019-09-17 14:23:22 -07:00
Constantin Nickel
6b5be07158 Sync async/blocking ClientBuilder::gzip doc comment 2019-09-17 09:48:26 -07:00
SOFe
23e8a4d58e Fixed incorrect description of ClientBuilder::gzip
"inflate" actually means decompress in the context of DEFLATE. "deflate" reduces the size of something, i.e. compression, and inflate is the opposite, i.e. decompression.
2019-09-13 11:24:23 -07:00
Constantin Nickel
b1a90eb402 Prune the futures dependencies 2019-09-12 07:52:31 -07:00
Sean McArthur
5a337ba739 Pin to a nightly rustc 2019-09-11 17:28:41 -07:00
Sean McArthur
5356776834 refine async API
- Converted `Response::text` and `Response::json` to `async fn`
- Added `Response::bytes` async fn as a counterpat to `text`.
- Added `Response::chunk` async fn to stream chunks of the response body.
- Added `From<Response> for Body` to allow piping a response as a request body.
- Removed `Decoder` from public API
- Removed body accessor methods from `Response`
- Removed `Chunk` type, replaced with `bytes::Bytes`.
- Removed public `impl Stream for Body`.
2019-09-10 14:06:09 -07:00
Sean McArthur
87a09322d6 Make the async Client default (#626)
The previously default Client is moved to `reqwest::blocking`, while the
async client becomes the main API.

Closes #622
2019-09-09 17:20:51 -07:00
Sean McArthur
5fb04356fc Re-enable rustls feature (#625) 2019-09-09 12:45:45 -07:00
Sean McArthur
ba7b2a754e refactor all to async/await (#617)
Co-authored-by: Danny Browning <danny.browning@protectwise.com>
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2019-09-06 17:22:56 -07:00
Lucas
d7fcd8ac2e Fix some multipart doc links (#612) 2019-09-05 11:48:39 -07:00
Lucas
80c4294b74 documented socks proxy (#609) 2019-09-05 09:37:21 -07:00
Nikhil Benesch
f60456c8e3 Upgrade to url v2.0 (#583) 2019-09-04 18:27:20 -07:00
danieleades
cf8944a0f0 cargo fmt (#604)
Run rustfmt and setup CI to check for it.
2019-08-29 09:52:39 -07:00
Bas De Bue
81e0f1ff2a Change Part::stream to reqwest::r#async::Chunk 2019-08-21 13:06:49 -07:00
Luca Bruno
8027a2894a tests: add more badssl tests for rustls 2019-08-20 14:05:34 -07:00
Luca Bruno
3033f11639 cargo: update to rustls 0.16 2019-08-20 14:05:34 -07:00
Daniel Eades
4bb4149b63 remove unnecessary double-colons 2019-08-16 12:59:55 -07:00
Daniel Eades
06353fbb1a remove deprecated 'try!' macro 2019-08-16 12:59:55 -07:00
Daniel Eades
e45d77584b repair a dodgy find and replace 2019-08-16 12:59:55 -07:00
Daniel Eades
3ba4b6eadf port all optional features to 2018-edition 2019-08-16 12:59:55 -07:00
Daniel Eades
4773408ae4 switch to 2018 edition module structure 2019-08-16 12:59:55 -07:00
Daniel Eades
1452ca2bd1 remove unnecessary extern crate lines 2019-08-16 12:59:55 -07:00
Daniel Eades
5dc5162765 update and tidy code 2019-08-16 12:59:55 -07:00
Daniel Eades
86d9cbc66e cargo fix --edition 2019-08-16 12:59:55 -07:00
Sean McArthur
c3b2a26c46 Prepare master for 0.10 breaking changes 2019-08-16 11:47:05 -07:00
Sean McArthur
fd96385097 fix bare trait object lint in dns module 2019-08-16 11:34:42 -07:00
Vignesh Karuthedath (വിഘ്നേഷ് ശ൪മ കെ)
36f2b78122 Give more useful errors when connection through proxy fails
Before the fix anything other than 200 & 407 would throw an unhelpful
`unsuccessful tunnel` error.
After this change,
- Explicit handling of 403, where the proxy forbids a connection.
- All other responses will be part of the error message.
2019-08-16 10:54:09 -07:00
Sean McArthur
b2fd1cf4d5 Increase Minimum Supported Rust Version to v.1.34.0
- `miniz_oxide` makes use of `TryFrom`
2019-08-14 12:02:57 -07:00
Sean McArthur
7d04fa1dfa Update to released mime_guess v2.0 2019-08-14 11:36:42 -07:00
Sean McArthur
d29e12db10 v0.9.19 2019-07-19 12:23:04 -07:00
Sean McArthur
afbd9e644d Improve error message when using blocking Client inside a Future 2019-07-19 11:47:35 -07:00
Timothée Ravier
9a9bcac336 Enable derive Clone for Certificate & Cert (#569)
This makes it easier to parse Certificates in advance and pass them as
clones for each client request.

Signed-off-by: Timothée Ravier <timothee.ravier@ssi.gouv.fr>
2019-07-18 09:50:40 -07:00
Sean McArthur
9276e2cce7 Fix unused_mut warning in src/tls 2019-07-09 15:11:57 -07:00
WindSoilder
24809dc23c revert docstring back because ClientBuilder don't use system proxy. (#556) 2019-07-03 19:10:14 -07:00
WindSoilder
577d06c363 Add support for system/environment proxies (#547) 2019-07-01 16:27:58 -07:00
messense
564a08f230 Add Response::json() test cases 2019-06-26 11:11:07 -07:00
messense
1e7c9fe507 Sync Response::text() & Response::json() call their async version 2019-06-26 11:11:07 -07:00
messense
c5f2bf6c32 Add Response::text() to async Client 2019-06-26 11:11:07 -07:00
messense
a3cd3633d8 Use dyn Trait feature in examples & tests (#553) 2019-06-25 21:16:20 -07:00
Dmitry Pankratov
e16aed5e3c Added support for sending requests with streaming Body (#545) 2019-06-14 10:29:54 -07:00
Sean McArthur
9f256405e5 v0.9.18 2019-06-06 11:33:03 -07:00
Sean McArthur
fabfa3eb70 Update docs about cookie store 2019-06-06 11:30:36 -07:00
Patrick Fernie
6e5ee3b975 disable percent encoding of cookie name/value when sending request 2019-06-06 11:05:14 -07:00
Sean McArthur
5096e12fa2 Use executor::enter before blocking a thread in wait 2019-06-05 14:41:53 -07:00
Sean McArthur
a701e93edb fix redundant TLSError import warning 2019-06-05 13:21:41 -07:00
Sean McArthur
964d87ce57 Update trait object syntax to use 'dyn' 2019-06-03 13:15:09 -07:00
nirasan
1d26d7b472 fix the travis android build (#528) 2019-05-17 11:00:00 -07:00
nirasan
2a64140de8 ci: fix appveyor build for backtrace-sys dependency (#526) 2019-05-16 14:41:24 -07:00
nirasan
9f22f46e85 Clarify correct specification of dependency on serde (#525)
Closes #494
2019-05-16 10:46:00 -07:00
Sean McArthur
11d477f49a v0.9.17 2019-05-15 13:22:42 -07:00