Update the docs for `Content-Length` and `Transfer-Encoding` to mention
that they are mutually exclusive, and that setting one will unset the
other, in accordance with RFC7230.
Also expand the docs for `Request::set_body` to say that chunked
encoding is used by default, and mention how to disable this feature.
This is a temporary function until the `TryFrom` trait stabilizes.
BREAKING CHANGE: Removes the undocumented `from_u16` function. Use
`StatusCode::try_from` instead.
Also makes the `status` module private. All imports of
`hyper::status::StatusCode` should be `hyper::StatusCode`.
On some OSes, `Instant` would start counting 0 from the boot time. That
would mean that any `Instant::now() - dur` soon after boot had a higher
risk of overflowing. Now, the expiration is determined by calling
`idle.elapsed()`, and comparing durations.
Closes#1215
The new mime crate has several benefits:
- Faster formatting
- Easier to use. Most common mime types are now just constants, like
`mime::TEXT_PLAIN`.
- Proper suffix support.
- Extensible without breaking backwards compatiblity. This means we can
always add new constants, but before we couldn't add new variants to the
enums.
- It's now impossible for a `Mime` to contain invalid tokens. Before,
with the `Ext(String)` variants, it was possible to create an illegal
mime.
Closes#738
BREAKING CHANGE: Most uses of `mime` will likely break. There is no more
`mime!` macro, nor a `Mime` constructor, nor `TopLevel` and `SubLevel`
enums.
Instead, in most cases, a constant exists that can now be used.
For less common mime types, they can be created by parsing a string.
The `RawStatus` types on the `Response` are now gone by default. To make
use of them, the `raw_status` feature must be enabled in `Cargo.toml`.
BREAKING CHANGE: To use `RawStatus`, you must enable the `raw_status`
crate feature.
Remove requirement when calling client::Config::connector() that the connector implements Connect.
Removing this requirement allows users to set the connector back to UseDefaultConnector. Previously,
this was not possible.