mirror of https://github.com/fafhrd91/actix-web
Additional methods for FrozenClientRequest
This commit is contained in:
parent
85a0d0721c
commit
d1fdebe437
|
@ -98,6 +98,11 @@ impl ClientRequest {
|
|||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Get HTTP URI of request
|
||||
pub fn get_uri(&self) -> &Uri {
|
||||
&self.head.uri
|
||||
}
|
||||
|
||||
/// Set socket address of the server.
|
||||
///
|
||||
|
@ -115,6 +120,11 @@ impl ClientRequest {
|
|||
self
|
||||
}
|
||||
|
||||
/// Get HTTP method of this request
|
||||
pub fn get_method(&self) -> &Method {
|
||||
&self.head.method
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
/// Set HTTP version of this request.
|
||||
///
|
||||
|
@ -561,6 +571,21 @@ pub struct FrozenClientRequest {
|
|||
}
|
||||
|
||||
impl FrozenClientRequest {
|
||||
/// Get HTTP URI of request
|
||||
pub fn get_uri(&self) -> &Uri {
|
||||
&self.head.uri
|
||||
}
|
||||
|
||||
/// Get HTTP method of this request
|
||||
pub fn get_method(&self) -> &Method {
|
||||
&self.head.method
|
||||
}
|
||||
|
||||
/// Returns request's headers.
|
||||
pub fn headers(&self) -> &HeaderMap {
|
||||
&self.head.headers
|
||||
}
|
||||
|
||||
/// Send body with optional extra headers.
|
||||
/// Extra headers will override corresponding existing headers in a frozen request.
|
||||
pub fn send_body<B>(
|
||||
|
|
Loading…
Reference in New Issue