Add support for getting HTTP version of a response

This commit is contained in:
Yash Srivastav
2018-07-06 22:30:30 -04:00
committed by Sean McArthur
parent a52520941f
commit 12cfbafc28
3 changed files with 18 additions and 3 deletions

View File

@@ -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