Commit Graph

456 Commits

Author SHA1 Message Date
Sean McArthur
44837c1b69 Replace getaddrinfo resolver with trust-dns-resolver 2018-12-18 12:54:22 -08:00
Sean McArthur
b259d7c5f3 Stop Appveyor from building PRs twice 2018-12-18 12:36:38 -08:00
Sean McArthur
49d2905011 allow deprecated Error::cause in test 2018-12-17 13:28:57 -08:00
Sean McArthur
11962e36ab allow deprecated on Error::cause 2018-12-17 12:23:30 -08:00
quininer
37039760f8 Add rustls support (#390) 2018-12-17 11:57:43 -08:00
polyfloyd
9cbd8c41ad Add try_clone to Request and RequestBuilder (#387)
The need to clone a request or builder may arise when repeating a
request multiple times. This can be either because:
* The Request object is consumed by Client::execute
* The request might need to be retried later
* A complex request needs to be repeated with slightly different
  parameters, such as in the Partial-Content scheme which allows seeking
  through the content of large object over HTTP by performing multiple
  HTTP GET requests.

To make this easier, it would be nice if Request and RequestBuilder
were to implement the Clone trait. However, this is not possible because
a body might be set that is a stream which can not be cloned. To get
around this, I added a try_clone function that fails if the body is not
clonable.

An alternative solution would be to add a type parameter to Request for
the body so a conditional implementation for Clone can be added.
2018-12-17 11:55:06 -08:00
Kornel
559f9634bc Don't panic if the client builder fails (#398) 2018-12-13 13:44:47 -08:00
Bastien Orivel
a13f89c4e5 Update base64 to 0.10 (#383) 2018-11-28 14:53:01 -08:00
Daniel Wagner-Hall
8217c43db2 Allow native-tls to be vendored (#391) 2018-11-28 14:52:23 -08:00
Sean McArthur
e2fa5497ef update deprecated Uri::port to port_part 2018-11-26 12:14:05 -08:00
Sean McArthur
459de48093 Bump minimum Rust version to 1.29.
Due to encoding_rs needing a newer compiler, we must update as well.
2018-11-21 12:27:35 -08:00
Danilo Bargen
4aa34bb591 Response.copy_to: Fix docs markup 2018-11-19 09:49:15 -08:00
Alex Gaynor
82bc1be89e Bumped env_logger to 0.6 2018-11-15 09:42:04 -08:00
Sean McArthur
6555261064 v0.9.5 2018-11-13 12:53:12 -08:00
David Wilemski
6ef2060510 Added dns_threads setter to sync ClientBuilder (#381) 2018-11-05 11:27:32 -08:00
KNnut
527bcecce6 fix typo about x-form-urlencoded doc 2018-11-05 11:26:11 -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
c91f37babf v0.9.4 2018-10-26 14:07:17 -07:00
Sean McArthur
70b68c2b0a add configuration to multipart::Form to choose percent-encoding format
Sets the default back to `path-segment`, since the "fix" breaks anyone
using reqwest from before.

Closes #363
2018-10-26 13:57:45 -07:00
Sean McArthur
e1a67f32aa v0.9.3 2018-10-17 14:25:19 -07:00
Sean McArthur
acd23d057a fix tests generating an extra blank Txn for each server 2018-10-17 14:17:08 -07:00
Sean McArthur
512b80a3ad ensure async request is canceled if there is a timeout 2018-10-17 13:38:54 -07:00
Sean McArthur
a82232f0ee always wait a max of 5 seconds for sync Client's background thread to start 2018-10-17 12:33:59 -07:00
Mark Blum
efa5926813 Added Part::bytes(...) method 2018-10-15 15:58:10 -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
44c8ca392d Fix multipart filename encoding (#363)
- Create a new encoding policy based on information
  from bug's comments and RFC documents
- Update tests accordingly

Closes #295
2018-10-05 11:22:53 -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
6c8f08a761 v0.9.2 2018-09-25 11:53:59 -07:00
Sean McArthur
423559625d bump libflate dependency to 0.1.18 2018-09-25 11:48:56 -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
2db72d1593 v0.9.1 2018-09-20 14:15:20 -07:00
Josh Mcguigan
aa6b1f4184 Added async example which makes multiple requests (#351) 2018-09-20 14:07:33 -07:00
Sean McArthur
15857a11a4 fix streaming body from wrongly returning 'closed connection' error 2018-09-19 16:38:33 -07:00
Sean McArthur
1a513efe39 reduce size of Error 2018-09-19 15:39: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
Sean McArthur
2698148743 fix improper handling of request body backpressure
Closes #348
2018-09-19 14:20:12 -07:00
Vlad Frolov
276c3d6594 Added JSON examples 2018-09-19 12:48:46 -07:00
Xeoeen
3a5af68b92 remove invalid headers after erasing body (#349) 2018-09-19 12:07:59 -07:00
Sean McArthur
76547fee91 v0.9.0 2018-09-18 14:36:18 -07:00
Sean McArthur
610cdd266c Fix panicking when passed a file:// URL
Closes #347
2018-09-18 12:43:54 -07:00
Laurent Arnoud
68d012e954 Try to fix docs.rs generation (#343)
https://github.com/seanmonstar/reqwest/issues/329
https://github.com/onur/docs.rs/issues/23#issuecomment-419623139
2018-09-12 15:59:56 -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