@@ -152,7 +152,6 @@ pub use hyper::header;
|
|||||||
pub use hyper::mime;
|
pub use hyper::mime;
|
||||||
pub use hyper::method::Method;
|
pub use hyper::method::Method;
|
||||||
pub use hyper::status::StatusCode;
|
pub use hyper::status::StatusCode;
|
||||||
pub use hyper::version::HttpVersion;
|
|
||||||
pub use hyper::Url;
|
pub use hyper::Url;
|
||||||
pub use url::ParseError as UrlError;
|
pub use url::ParseError as UrlError;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ use std::io::{self, Read};
|
|||||||
|
|
||||||
use hyper::header::{Headers, ContentEncoding, ContentLength, Encoding, TransferEncoding};
|
use hyper::header::{Headers, ContentEncoding, ContentLength, Encoding, TransferEncoding};
|
||||||
use hyper::status::StatusCode;
|
use hyper::status::StatusCode;
|
||||||
use hyper::version::HttpVersion;
|
|
||||||
use hyper::Url;
|
use hyper::Url;
|
||||||
use libflate::gzip;
|
use libflate::gzip;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
@@ -30,7 +29,6 @@ impl fmt::Debug for Response {
|
|||||||
.field("url", &hyper_response.url)
|
.field("url", &hyper_response.url)
|
||||||
.field("status", &hyper_response.status)
|
.field("status", &hyper_response.status)
|
||||||
.field("headers", &hyper_response.headers)
|
.field("headers", &hyper_response.headers)
|
||||||
.field("version", &hyper_response.version)
|
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
Decoder::Gzip { ref head, .. } |
|
Decoder::Gzip { ref head, .. } |
|
||||||
@@ -39,7 +37,6 @@ impl fmt::Debug for Response {
|
|||||||
.field("url", &head.url)
|
.field("url", &head.url)
|
||||||
.field("status", &head.status)
|
.field("status", &head.status)
|
||||||
.field("headers", &head.headers)
|
.field("headers", &head.headers)
|
||||||
.field("version", &head.version)
|
|
||||||
.finish()
|
.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,16 +74,6 @@ impl Response {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the `HttpVersion`.
|
|
||||||
#[inline]
|
|
||||||
pub fn version(&self) -> &HttpVersion {
|
|
||||||
match self.inner {
|
|
||||||
Decoder::PlainText(ref hyper_response) => &hyper_response.version,
|
|
||||||
Decoder::Gzip { ref head, .. } |
|
|
||||||
Decoder::Errored { ref head, .. } => &head.version,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Try and deserialize the response body as JSON using `serde`.
|
/// Try and deserialize the response body as JSON using `serde`.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -192,7 +179,6 @@ fn new_gzip(mut res: ::hyper::client::Response) -> Decoder {
|
|||||||
headers: res.headers.clone(),
|
headers: res.headers.clone(),
|
||||||
status: res.status,
|
status: res.status,
|
||||||
url: res.url.clone(),
|
url: res.url.clone(),
|
||||||
version: res.version,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,7 +187,6 @@ fn new_gzip(mut res: ::hyper::client::Response) -> Decoder {
|
|||||||
headers: res.headers.clone(),
|
headers: res.headers.clone(),
|
||||||
status: res.status,
|
status: res.status,
|
||||||
url: res.url.clone(),
|
url: res.url.clone(),
|
||||||
version: res.version,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let reader = Peeked {
|
let reader = Peeked {
|
||||||
@@ -223,7 +208,6 @@ fn new_gzip(mut res: ::hyper::client::Response) -> Decoder {
|
|||||||
struct Head {
|
struct Head {
|
||||||
headers: ::hyper::header::Headers,
|
headers: ::hyper::header::Headers,
|
||||||
url: ::hyper::Url,
|
url: ::hyper::Url,
|
||||||
version: ::hyper::version::HttpVersion,
|
|
||||||
status: ::hyper::status::StatusCode,
|
status: ::hyper::status::StatusCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user