Struct hyper::client::Request
[−]
[src]
pub struct Request<B = Body> { /* fields omitted */ }
An HTTP Request
Methods
impl<B> Request<B>
[src]
impl<B> Request<B>
pub fn new(method: Method, uri: Uri) -> Request<B>
[src]
pub fn new(method: Method, uri: Uri) -> Request<B>
Construct a new Request.
pub fn uri(&self) -> &Uri
[src]
pub fn uri(&self) -> &Uri
Read the Request Uri.
pub fn version(&self) -> HttpVersion
[src]
pub fn version(&self) -> HttpVersion
Read the Request Version.
pub fn headers(&self) -> &Headers
[src]
pub fn headers(&self) -> &Headers
Read the Request headers.
pub fn method(&self) -> &Method
[src]
pub fn method(&self) -> &Method
Read the Request method.
pub fn body_ref(&self) -> Option<&B>
[src]
pub fn body_ref(&self) -> Option<&B>
Read the Request body.
pub fn body_mut(&mut self) -> &mut Option<B>
[src]
pub fn body_mut(&mut self) -> &mut Option<B>
Get a mutable reference to the Request body.
pub fn path(&self) -> &str
[src]
pub fn path(&self) -> &str
The target path of this Request.
pub fn query(&self) -> Option<&str>
[src]
pub fn query(&self) -> Option<&str>
The query string of this Request.
pub fn set_method(&mut self, method: Method)
[src]
pub fn set_method(&mut self, method: Method)
Set the Method of this request.
pub fn headers_mut(&mut self) -> &mut Headers
[src]
pub fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the Request headers.
pub fn set_uri(&mut self, uri: Uri)
[src]
pub fn set_uri(&mut self, uri: Uri)
Set the Uri
of this request.
pub fn set_version(&mut self, version: HttpVersion)
[src]
pub fn set_version(&mut self, version: HttpVersion)
Set the HttpVersion
of this request.
pub fn set_body<T: Into<B>>(&mut self, body: T)
[src]
pub fn set_body<T: Into<B>>(&mut self, body: T)
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]
pub fn set_proxy(&mut self, is_proxy: bool)
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]
impl Request<Body>
pub fn deconstruct(self) -> (Method, Uri, HttpVersion, Headers, Body)
[src]
pub fn deconstruct(self) -> (Method, Uri, HttpVersion, Headers, Body)
Deconstruct this Request into its pieces.
Modifying these pieces will have no effect on how hyper behaves.
pub fn body(self) -> Body
[src]
pub fn body(self) -> Body
Take the Request body.
Trait Implementations
impl<B> Debug for Request<B>
[src]
impl<B> Debug for Request<B>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<Message<__ProtoRequest, Body<Chunk, Error>>> for Request
[src]
impl From<Message<__ProtoRequest, Body<Chunk, Error>>> for Request