[][src]Struct hyper::client::Request

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]

impl From<Message<__ProtoRequest, Body<Chunk, Error>>> for Request[src]

Auto Trait Implementations

impl<B = Body> !RefUnwindSafe for Request<B>

impl<B> Send for Request<B> where
    B: Send

impl<B = Body> !Sync for Request<B>

impl<B> Unpin for Request<B> where
    B: Unpin

impl<B = Body> !UnwindSafe for Request<B>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.