Struct hyper::client::request::Request [−][src]
pub struct Request<W> {
pub url: Url,
pub version: HttpVersion,
// some fields omitted
}
Expand description
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.
Implementations
pub fn with_message(
method: Method,
url: Url,
message: Box<dyn HttpMessage>
) -> Result<Request<Fresh>>
pub fn with_message(
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 with_connector<C, S>(
method: Method,
url: Url,
connector: &C
) -> Result<Request<Fresh>> where
C: NetworkConnector<Stream = S>,
S: Into<Box<dyn NetworkStream + Send>>,
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>>,
Create a new client request with a specific underlying NetworkStream.
Consume a Fresh Request, writing the headers and method, returning a Streaming Request.
Get a mutable reference to the Request headers.
Trait Implementations
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Auto Trait Implementations
impl<W> !RefUnwindSafe for Request<W>
impl<W> !UnwindSafe for Request<W>
Blanket Implementations
Mutably borrows from an owned value. Read more
Writes an unsigned 8 bit integer to the underlying writer. Read more
Writes a signed 8 bit integer to the underlying writer. Read more
Writes an unsigned 16 bit integer to the underlying writer. Read more
Writes a signed 16 bit integer to the underlying writer. Read more
Writes an unsigned 24 bit integer to the underlying writer. Read more
Writes a signed 24 bit integer to the underlying writer. Read more
Writes an unsigned 32 bit integer to the underlying writer. Read more
Writes a signed 32 bit integer to the underlying writer. Read more
Writes an unsigned 48 bit integer to the underlying writer. Read more
Writes a signed 48 bit integer to the underlying writer. Read more
Writes an unsigned 64 bit integer to the underlying writer. Read more
Writes a signed 64 bit integer to the underlying writer. Read more
Writes an unsigned 128 bit integer to the underlying writer.
Writes a signed 128 bit integer to the underlying writer.
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more