Commit Graph

80 Commits

Author SHA1 Message Date
Michael Habib
4dc679d535 Add ClientBuilder::local_address option to bind to a local IP address (#451)
Closes #414
2019-02-11 10:40:16 -08:00
Evan Schwartz
6e8e781f8f Add ClientBuilder::h2_prior_knowlege() (#443)
resolves https://github.com/seanmonstar/reqwest/issues/413
2019-01-18 14:15:57 -08:00
Sean McArthur
021851afd4 Enable h2 ALPN with rustls-tls backend 2019-01-18 11:53:56 -08:00
Sean McArthur
68e98d54ea Add Response::content_length() method 2019-01-18 11:42:27 -08:00
Sean McArthur
81b4d26682 Try to detect Certificate and Identity errors earlier 2019-01-11 15:43:00 -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
Shou Ya
b129ab0bb4 fix multipart with unicode filename (#420) 2019-01-08 21:01:52 -08:00
Sean McArthur
691bcfe894 improve general documentation 2019-01-07 14:20:39 -08:00
Sean McArthur
56eff821fd refactor multipart to reduce duplicate code between sync and async 2019-01-07 13:40:04 -08:00
Kevin Wilson
4c21127f15 add async multipart request handling 2019-01-07 10:57:51 -08:00
Sean McArthur
11d7812e88 rename Incompatile error kind to TlsIncompatible 2019-01-04 14:46:58 -08:00
Sean McArthur
ad854c3ee8 add Proxy::basic_auth support
Closes #322
2019-01-04 14:40:19 -08:00
Sean McArthur
b9f4661332 rename TLSBackend to TlsBackend 2019-01-03 12:43:22 -08:00
Sean McArthur
9c0c5ca42d Fix RequestBuilder::headers to include multiple values
`RequestBuilder::headers` will always overwrite any existing header with
the same name, but will now correctly append extra values from the *new*
header map.

Closes #407
2019-01-03 12:28:03 -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
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
478ef9bf15 add Response::remote_addr() method
The new `remote_addr` method returns an `Option<SocketAddr>`, which is
`Some` if the underlying transport uses socket addresses.

Closes #373
2018-10-26 14:23:33 -07:00
Sean McArthur
e40cc33e52 fix unreachable code if polling async Body created from a single buffer 2018-10-05 13:03:00 -07:00
Yannick Heinrich
c4bf420021 Integrate helper functions inside corresponding structs 2018-10-05 11:19:52 -07:00
Yannick Heinrich
647f59756e Add missing pub(crate) statements. 2018-10-05 11:19:52 -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
Yannick Heinrich
22fa725f48 Document gzip client's behaviour (#358)
As suggested in #306, the behaviour of the `auto gzip decompression` should
be clearly explained inside the documentation.

Closes #306
2018-10-03 10:14:41 -07:00
Sean McArthur
680387f790 try utf8 for location headers 2018-09-25 11:46:46 -07:00
Sean McArthur
cd7dbe226c log invalid location header value on error 2018-09-21 14:22:41 -07:00
Sean McArthur
5bf94e7bdd fix panic if Location header is not a valid string
Closes #354
2018-09-21 14:13:32 -07:00
Sean McArthur
449ec8f1f3 remove extra size_of tests 2018-09-19 15:28:20 -07:00
Sean McArthur
0735e586e5 reduce size of Response, async::Response, and async::Decoder 2018-09-19 15:23:01 -07:00
Xeoeen
3a5af68b92 remove invalid headers after erasing body (#349) 2018-09-19 12:07:59 -07:00
Sean McArthur
610cdd266c Fix panicking when passed a file:// URL
Closes #347
2018-09-18 12:43:54 -07:00
Sean McArthur
55fcedcf97 pub(crate)ify the async::client module 2018-09-11 14:37:50 -07:00
Sean McArthur
1ded95ce0e pub(crate)ify the async::request module 2018-09-11 14:33:38 -07:00
Sean McArthur
2f893718ba pub(crate)ify async::response module 2018-09-11 14:27:28 -07:00
Sean McArthur
b95de15587 change Response::version() to return Version by value 2018-09-11 14:22:21 -07:00
Sean McArthur
13cfc4df85 refactor redirect facade to use pub(crate) 2018-08-23 10:04:25 -07:00
Sean McArthur
ef529df3f2 remove inline annotations on client builder methods 2018-08-23 10:04:25 -07:00
Sean McArthur
afbeb1a384 change ClientBuilders to by-value builders 2018-08-23 10:04:25 -07:00
Sean McArthur
e182c416c9 add hyper-011 cargo feature to ease migration 2018-08-15 16:47:02 -07:00
Sean McArthur
3fbda4fd49 remove unstable language and feature 2018-08-15 16:08:47 -07:00
Sean McArthur
d060891b62 fix async request builder tests 2018-08-15 15:36:05 -07:00
Sean McArthur
591b83a8b8 remove some unwraps 2018-08-15 15:22:28 -07:00
Konrad Borowski
279725ee5e Change RequestBuilder methods to own a builder
This means that `build` cannot possibly panic anymore due to being
called multiple times. This is a breaking change as it breaks the
behaviour of builder methods called without assigning to a new variable
or chaining. It's rather easy to fix those usages, as they won't
compile anymore and can be fixed by assigning a result.

Additionally, this change reduces the size of `RequestBuilder`,
although this likely isn't all that meaningful, as usually there
is no reason to store builders in structures.
2018-08-15 12:56:28 -07:00
Scott Schroeder
d8e47babf6 change invalid cert api to match native-tls (#327) 2018-08-13 15:08:02 -07:00
Yannick Heinrich
11f8588989 upgrade to native-tls 0.2 + invalid certs (#325)
- Bumps `native-tls` dependency to 0.2 and adapt code accordingly
- Import code used from `tokio-tls` into `connect_async` and adapt dependencies accordinlgy
- Add an option for using `danger_accept_invalid_certs` inside the `Config` struct
2018-08-08 13:14:36 -07:00
Douman
a25f62f4cb Use base64 to fully encode basic auth creds
Change basic_auth to use less allocations
2018-07-31 13:54:44 -07:00
Yash Srivastav
12cfbafc28 Add support for getting HTTP version of a response 2018-07-31 13:53:42 -07:00
Sean McArthur
6c78e363e0 remote tokio-core dependency 2018-07-05 14:06:01 -07:00
Yash Srivastav
c417d6dab8 Upgrade hyper to 0.12
Closes #304
2018-07-05 10:03:31 -07:00
Ben Shaw
7bd3619ece fix query doc typo (#309) 2018-06-26 18:40:28 -07:00
Mattias Päivärinta
31504388d7 Add status code accessor to RedirectAttempt (#285) 2018-04-15 15:11:50 -07:00