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
This commit is contained in:
committed by
Sean McArthur
parent
6c8f08a761
commit
22fa725f48
@@ -166,6 +166,14 @@ impl ClientBuilder {
|
||||
|
||||
/// Enable auto gzip decompression by checking the ContentEncoding response header.
|
||||
///
|
||||
/// If auto gzip decompresson is turned on:
|
||||
/// - When sending a request and if the request's headers do not already contain
|
||||
/// an `Accept-Encoding` **and** `Range` values, the `Accept-Encoding` header is set to `gzip`.
|
||||
/// The body is **not** automatically inflated.
|
||||
/// - When receiving a response, if it's headers contain a `Content-Encoding` value that
|
||||
/// equals to `gzip`, both values `Content-Encoding` and `Content-Length` are removed from the
|
||||
/// headers' set. The body is automatically deinflated.
|
||||
///
|
||||
/// Default is enabled.
|
||||
pub fn gzip(mut self, enable: bool) -> ClientBuilder {
|
||||
self.config.gzip = enable;
|
||||
|
||||
@@ -212,6 +212,14 @@ impl ClientBuilder {
|
||||
|
||||
/// Enable auto gzip decompression by checking the ContentEncoding response header.
|
||||
///
|
||||
/// If auto gzip decompresson is turned on:
|
||||
/// - When sending a request and if the request's headers do not already contain
|
||||
/// an `Accept-Encoding` **and** `Range` values, the `Accept-Encoding` header is set to `gzip`.
|
||||
/// The body is **not** automatically inflated.
|
||||
/// - When receiving a response, if it's headers contain a `Content-Encoding` value that
|
||||
/// equals to `gzip`, both values `Content-Encoding` and `Content-Length` are removed from the
|
||||
/// headers' set. The body is automatically deinflated.
|
||||
///
|
||||
/// Default is enabled.
|
||||
pub fn gzip(self, enable: bool) -> ClientBuilder {
|
||||
self.with_inner(|inner| inner.gzip(enable))
|
||||
|
||||
Reference in New Issue
Block a user