From d1fdebe437980be6490ca1ff9638354a1480ab1d Mon Sep 17 00:00:00 2001 From: Dmitry Pypin Date: Wed, 28 Aug 2019 14:05:20 -0700 Subject: [PATCH] Additional methods for FrozenClientRequest --- awc/src/request.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/awc/src/request.rs b/awc/src/request.rs index 483c3970e..f09ba69bb 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -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(