[−][src]Struct hyper::client::request::Request
A client request to a remote server. The W type tracks the state of the request, Fresh vs Streaming.
Fields
url: Url
The target URI for this request.
version: HttpVersion
The HTTP version of this request.
Methods
impl<W> Request<W>
[src][−]
pub fn headers(&self) -> &Headers
[src][−]
Read the Request headers.
pub fn method(&self) -> Method
[src][−]
Read the Request method.
pub fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
[src][−]
Set the write timeout.
pub fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
[src][−]
Set the read timeout.
impl Request<Fresh>
[src][−]
pub fn with_message(
method: Method,
url: Url,
message: Box<dyn HttpMessage>
) -> Result<Request<Fresh>>
[src][−]
method: Method,
url: Url,
message: Box<dyn HttpMessage>
) -> Result<Request<Fresh>>
Create a new Request<Fresh>
that will use the given HttpMessage
for its communication
with the server. This implies that the given HttpMessage
instance has already been
properly initialized by the caller (e.g. a TCP connection's already established).
pub fn new(method: Method, url: Url) -> Result<Request<Fresh>>
[src][−]
Create a new client request.
pub fn with_connector<C, S>(
method: Method,
url: Url,
connector: &C
) -> Result<Request<Fresh>> where
C: NetworkConnector<Stream = S>,
S: Into<Box<dyn NetworkStream + Send>>,
[src][−]
method: Method,
url: Url,
connector: &C
) -> Result<Request<Fresh>> where
C: NetworkConnector<Stream = S>,
S: Into<Box<dyn NetworkStream + Send>>,
Create a new client request with a specific underlying NetworkStream.
pub fn start(self) -> Result<Request<Streaming>>
[src][−]
Consume a Fresh Request, writing the headers and method, returning a Streaming Request.
pub fn headers_mut(&mut self) -> &mut Headers
[src][−]
Get a mutable reference to the Request headers.
impl Request<Streaming>
[src][−]
pub fn send(self) -> Result<Response>
[src][−]
Completes writing the request, and returns a response to read from.
Consumes the Request.
Trait Implementations
Auto Trait Implementations
impl<W> !RefUnwindSafe for Request<W>
impl<W> Send for Request<W> where
W: Send,
W: Send,
impl<W> !Sync for Request<W>
impl<W> Unpin for Request<W> where
W: Unpin,
W: Unpin,
impl<W> !UnwindSafe for Request<W>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
[src][+]
T: Any,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
[src][+]
W: Write + ?Sized,