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.

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) -> HttpResult<Request<Fresh>>

Create a new client request.

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

Create a new client request with a specific underlying NetworkStream.

fn start(self) -> HttpResult<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) -> HttpResult<Response>

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

Consumes the Request.

Trait Implementations

impl Writer for Request<Streaming>

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

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

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

fn write_str(&mut self, s: &str) -> Result<(), IoError>

fn write_line(&mut self, s: &str) -> Result<(), IoError>

fn write_char(&mut self, c: char) -> Result<(), IoError>

fn write_int(&mut self, n: isize) -> Result<(), IoError>

fn write_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_le_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_le_int(&mut self, n: isize) -> Result<(), IoError>

fn write_be_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_be_int(&mut self, n: isize) -> Result<(), IoError>

fn write_be_u64(&mut self, n: u64) -> Result<(), IoError>

fn write_be_u32(&mut self, n: u32) -> Result<(), IoError>

fn write_be_u16(&mut self, n: u16) -> Result<(), IoError>

fn write_be_i64(&mut self, n: i64) -> Result<(), IoError>

fn write_be_i32(&mut self, n: i32) -> Result<(), IoError>

fn write_be_i16(&mut self, n: i16) -> Result<(), IoError>

fn write_be_f64(&mut self, f: f64) -> Result<(), IoError>

fn write_be_f32(&mut self, f: f32) -> Result<(), IoError>

fn write_le_u64(&mut self, n: u64) -> Result<(), IoError>

fn write_le_u32(&mut self, n: u32) -> Result<(), IoError>

fn write_le_u16(&mut self, n: u16) -> Result<(), IoError>

fn write_le_i64(&mut self, n: i64) -> Result<(), IoError>

fn write_le_i32(&mut self, n: i32) -> Result<(), IoError>

fn write_le_i16(&mut self, n: i16) -> Result<(), IoError>

fn write_le_f64(&mut self, f: f64) -> Result<(), IoError>

fn write_le_f32(&mut self, f: f32) -> Result<(), IoError>

fn write_u8(&mut self, n: u8) -> Result<(), IoError>

fn write_i8(&mut self, n: i8) -> Result<(), IoError>