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
2018-10-26 14:23:33 -07:00
2017-10-22 13:27:20 +08:00
2018-11-21 12:27:35 -08:00
2018-11-28 14:53:01 -08:00
2018-11-13 12:53:12 -08:00
2016-06-30 17:23:51 -07:00
2016-12-13 15:47:28 -08:00
2017-08-25 13:52:40 -07:00

reqwest

Travis CI Status Appveyor CI Status crates.io

An ergonomic HTTP Client for Rust.

Built on top of hyper, with a batteries-included mindset.

Requirements

On Linux:

On Windows and macOS:

  • Nothing.

Reqwest uses rust-native-tls, which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use OpenSSL 1.1.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Description
No description provided
Readme 2 MiB
Languages
Rust 99.6%
Nix 0.4%