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

pub struct Request<W> {
    pub url: Url,
    pub version: HttpVersion,
    // some fields omitted
}

A client request to a remote server. The W type tracks the state of the request, Fresh vs Streaming.

Fields

url

The target URI for this request.

version

The HTTP version of this request.

Methods

impl<W> Request<W>

fn headers(&self) -> &Headers

Read the Request headers.

fn method(&self) -> Method

Read the Request method.

impl Request<Fresh>

fn new(method: Method, url: Url) -> Result<Request<Fresh>>

Create a new client request.

fn with_connector<C, S>(method: Method, url: Url, connector: &C) -> Result<Request<Fresh>> where C: NetworkConnector<Stream=S>, S: Into<Box<NetworkStream + Send>>

Create a new client request with a specific underlying NetworkStream.

fn start(self) -> Result<Request<Streaming>>

Consume a Fresh Request, writing the headers and method, returning a Streaming Request.

fn headers_mut(&mut self) -> &mut Headers

Get a mutable reference to the Request headers.

impl Request<Streaming>

fn send(self) -> Result<Response>

Completes writing the request, and returns a response to read from.

Consumes the Request.

Trait Implementations

impl Write for Request<Streaming>

fn write(&mut self, msg: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write