Struct hyper::client::Request
[−]
[src]
pub struct Request<B = Body> { /* fields omitted */ }
An HTTP Request
Methods
impl<B> Request<B>
[src]
pub fn new(method: Method, uri: Uri) -> Request<B>
[src]
Construct a new Request.
pub fn uri(&self) -> &Uri
[src]
Read the Request Uri.
pub fn version(&self) -> HttpVersion
[src]
Read the Request Version.
pub fn headers(&self) -> &Headers
[src]
Read the Request headers.
pub fn method(&self) -> &Method
[src]
Read the Request method.
pub fn body_ref(&self) -> Option<&B>
[src]
Read the Request body.
pub fn body_mut(&mut self) -> &mut Option<B>
[src]
Get a mutable reference to the Request body.
pub fn path(&self) -> &str
[src]
The target path of this Request.
pub fn query(&self) -> Option<&str>
[src]
The query string of this Request.
pub fn set_method(&mut self, method: Method)
[src]
Set the Method of this request.
pub fn headers_mut(&mut self) -> &mut Headers
[src]
Get a mutable reference to the Request headers.
pub fn set_uri(&mut self, uri: Uri)
[src]
Set the Uri
of this request.
pub fn set_version(&mut self, version: HttpVersion)
[src]
Set the HttpVersion
of this request.
pub fn set_body<T: Into<B>>(&mut self, body: T)
[src]
Set the body of the request.
By default, the body will be sent using Transfer-Encoding: chunked
. To
override this behavior, manually set a [ContentLength
] header with the
length of body
.
pub fn set_proxy(&mut self, is_proxy: bool)
[src]
Set that the URI should use the absolute form.
This is only needed when talking to HTTP/1 proxies to URLs not protected by TLS.
impl Request<Body>
[src]
pub fn deconstruct(self) -> (Method, Uri, HttpVersion, Headers, Body)
[src]
Deconstruct this Request into its pieces.
Modifying these pieces will have no effect on how hyper behaves.
pub fn body(self) -> Body
[src]
Take the Request body.
Trait Implementations
impl<B> Debug for Request<B>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more