9cbd8c41ad26aedac355e378c0bbb5f43978b7a3
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.
reqwest
An ergonomic HTTP Client for Rust.
Built on top of hyper, with a batteries-included mindset.
Requirements
On Linux:
- OpenSSL 1.0.1, 1.0.2, or 1.1.0 with headers (see https://github.com/sfackler/rust-openssl)
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
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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
Languages
Rust
99.6%
Nix
0.4%