Add support for getting HTTP version of a response
This commit is contained in:
committed by
Sean McArthur
parent
a52520941f
commit
12cfbafc28
@@ -12,7 +12,7 @@ use serde_json;
|
||||
|
||||
use client::KeepCoreThreadAlive;
|
||||
use hyper::header::HeaderMap;
|
||||
use {async_impl, StatusCode, Url, wait};
|
||||
use {async_impl, StatusCode, Url, Version, wait};
|
||||
|
||||
/// A Response to a submitted `Request`.
|
||||
pub struct Response {
|
||||
@@ -122,6 +122,12 @@ impl Response {
|
||||
self.inner.headers()
|
||||
}
|
||||
|
||||
/// Get the `Version` of this `Response`.
|
||||
#[inline]
|
||||
pub fn version(&self) -> &Version {
|
||||
self.inner.version()
|
||||
}
|
||||
|
||||
/// Try and deserialize the response body as JSON using `serde`.
|
||||
///
|
||||
/// # Examples
|
||||
|
||||
Reference in New Issue
Block a user