Commit Graph

179 Commits

Author SHA1 Message Date
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
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
danieleades
cf8944a0f0 cargo fmt (#604)
Run rustfmt and setup CI to check for it.
2019-08-29 09:52:39 -07:00
Daniel Eades
1452ca2bd1 remove unnecessary extern crate lines 2019-08-16 12:59:55 -07:00
Daniel Eades
86d9cbc66e cargo fix --edition 2019-08-16 12:59:55 -07:00
Sean McArthur
d29e12db10 v0.9.19 2019-07-19 12:23:04 -07:00
WindSoilder
577d06c363 Add support for system/environment proxies (#547) 2019-07-01 16:27:58 -07:00
Sean McArthur
fabfa3eb70 Update docs about cookie store 2019-06-06 11:30:36 -07:00
Sean McArthur
5096e12fa2 Use executor::enter before blocking a thread in wait 2019-06-05 14:41:53 -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
Sean McArthur
bf5a268079 v0.9.16 2019-04-30 15:27:12 -07:00
Guillaume Gomez
66a88d946b Add doc-comment to test README examples (#515) 2019-04-30 14:11:10 -07:00
Chen Rotem Levy
265065f20d Typo in rustdoc (#507)
s/certicates/certificates/
2019-04-24 10:29:23 -07:00
Sean McArthur
08054a3984 v0.9.15 2019-04-15 12:36:27 -07:00
Sean McArthur
9ddeb5ad22 v0.9.14 2019-04-09 13:13:53 -07:00
Sean McArthur
8ee46f89f8 update docs and readme about cookies and socks 2019-04-09 12:57:53 -07:00
Christoph Herzog
954fdfae30 Implement cookie store support
This commit introduces a cookie store / session support
for both the async and the sync client.

Functionality is based on the cookie crate,
which provides a HTTP cookie abstraction,
and the cookie_store crate which provides a
store that handles cookie storage and url/expiration
based cookie resolution for requests.

Changes:
* adds new private dependencies: time, cookie, cookie_store
* a new cookie module which provides wrapper types around
    the dependency crates
* a Response::cookies() accessor for iterating over response cookies
* a ClientBuilder::cookie_store() method that enables session functionality
* addition of a cookie_store member to the async client
* injecting request cookies and persisting response cookies
* cookie tests

NOTE: this commit DOES NOT expose the CookieStore itself,
limiting available functionality.

This is desirable, but omitted for now due to API considerations that should be fleshed out in the future.
This means users do not have direct access to the cookie session for now.
2019-04-09 12:54:10 -07:00
Diggory Blake
c45ff29bfb Add support for SOCKS5 proxies, and parsing proxy authorizations from URLs 2019-04-08 11:42:18 -07:00
Sean McArthur
871ec6f989 v0.9.13 2019-04-01 18:45:16 -07:00
Sean McArthur
f77ec53e59 v0.9.12 2019-03-20 14:18:39 -07:00
quininer
3554b0ad26 replace libflate with flate2 (#476) 2019-03-19 13:21:43 -07:00
Sean McArthur
d7475d61f2 v0.9.11 2019-03-04 11:41:54 -08:00
Sean McArthur
9e2b56ba56 Add connect_timeout to async and sync clients 2019-02-20 15:15:55 -08:00
Sean McArthur
66db8d6283 refactor connect_async module into connect module 2019-02-20 15:15:55 -08:00
Sean McArthur
5deb5705f5 v0.9.10 2019-02-18 11:54:14 -08:00
Sean McArthur
d2eee8591a v0.9.9 2019-01-23 12:20:44 -08:00
Sean McArthur
10c0e64711 v0.9.8 2019-01-11 17:33:29 -08:00
Sean McArthur
4d221533a2 Switch trust-dns to an off-by-default optional feature 2019-01-11 17:30:10 -08:00
Sean McArthur
23e13304ef Disable trust-dns on Windows
Closes #431
2019-01-11 12:34:03 -08:00
Sean McArthur
a8174feca4 v0.9.7 2019-01-10 13:58:23 -08:00
Sean McArthur
2649f9ab56 Remove trust-dns when target_os is Android 2019-01-10 13:52:35 -08:00
Sean McArthur
b71787be86 refactor DNS resolver construction
- System Conf is read as `ClientBuilder::build()` time, providing the
  error earlier.
- If there is an error reading the resolve system conf, a better error
  is reported.
- Resolver only needs to lock a mutex once to spawn the background task,
  instead of every single `resolve` call.
2019-01-10 12:47:29 -08:00
Martin Taibr
5578c77597 Fix typos (#422) 2019-01-08 12:12:50 -08:00
Sean McArthur
3112d99b7c v0.9.6 2019-01-07 15:44:37 -08:00
Sean McArthur
691bcfe894 improve general documentation 2019-01-07 14:20:39 -08:00
Kevin Wilson
4c21127f15 add async multipart request handling 2019-01-07 10:57:51 -08:00
Sean McArthur
dd5b95fc06 document native-tls-vendored and rustls-tls features 2019-01-03 11:33:20 -08:00
Sean McArthur
9ddc45438c remove no-longer-needed docs_rs_workaround 2019-01-03 11:29:46 -08:00
Sean McArthur
44837c1b69 Replace getaddrinfo resolver with trust-dns-resolver 2018-12-18 12:54:22 -08:00
quininer
37039760f8 Add rustls support (#390) 2018-12-17 11:57:43 -08:00
Kornel
559f9634bc Don't panic if the client builder fails (#398) 2018-12-13 13:44:47 -08:00
Sean McArthur
6555261064 v0.9.5 2018-11-13 12:53:12 -08:00
Sean McArthur
97393143a5 put all TLS functionality behind a feature flag
The "Cargo feature" `default-tls`, which is enabled by default, is
added, with all TLS support relying on it. This allows using reqwest but
disabling the `native-tls` dependency, by disabling this feature.

Closes #225
2018-10-29 16:37:25 -07:00
Sean McArthur
c91f37babf v0.9.4 2018-10-26 14:07:17 -07:00
Sean McArthur
e1a67f32aa v0.9.3 2018-10-17 14:25:19 -07:00
Paul Woolcock
4857a5917d From<http::Response> for Response (#360)
This adds an implementation to convert a `Response` type from the `http`
crate to the `async_impl::Response` type. This is the first step to
allow us to convert `http::Response` objects to `request::Response`
objects

This also adds an extension trait for the `http::response::Builder`
type. The `http::Response` object does not provide a way to access the
"final" url that the response is derived from, so we can't easily
provide that in the `From<http::Response>` implementation. For users who
are manually constructing `http::Response` objects for use in tests,
etc, they can import this extension trait, which adds a `.url()` builder
method that will allow them to pass a `Url`, which we then convert to
our newtype'd Url and add to the `http::Response`'s `extensions`. Then,
when converting from `http::Response` to `async_impl::Response` we can
pull that value out of the `extensions` and use it to construct the
`async_impl::Response`

Closes #333
2018-10-04 17:38:26 -07:00
Sean McArthur
6c8f08a761 v0.9.2 2018-09-25 11:53:59 -07:00
Sean McArthur
2db72d1593 v0.9.1 2018-09-20 14:15:20 -07:00