mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
Merge pull request #1101 from actix/add-awc-get-head-methods
Add remaining getter methods from private head field
This commit is contained in:
commit
959f7754b2
@ -96,7 +96,7 @@ impl ClientRequest {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get HTTP URI of request
|
/// Get HTTP URI of request.
|
||||||
pub fn get_uri(&self) -> &Uri {
|
pub fn get_uri(&self) -> &Uri {
|
||||||
&self.head.uri
|
&self.head.uri
|
||||||
}
|
}
|
||||||
@ -132,6 +132,16 @@ impl ClientRequest {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get HTTP version of this request.
|
||||||
|
pub fn get_version(&self) -> &Version {
|
||||||
|
&self.head.version
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get peer address of this request.
|
||||||
|
pub fn get_peer_addr(&self) -> &Option<net::SocketAddr> {
|
||||||
|
&self.head.peer_addr
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// Returns request's headers.
|
/// Returns request's headers.
|
||||||
pub fn headers(&self) -> &HeaderMap {
|
pub fn headers(&self) -> &HeaderMap {
|
||||||
|
Loading…
Reference in New Issue
Block a user