pub struct SendRequest<B> { /* private fields */ }
Available on crate feature
client
and (crate features http1
or http2
) only.Expand description
The sender side of an established connection.
Implementations§
source§impl<B> SendRequest<B>
impl<B> SendRequest<B>
source§impl<B> SendRequest<B>where
B: Body + 'static,
impl<B> SendRequest<B>where
B: Body + 'static,
sourcepub fn send_request(
&mut self,
req: Request<B>
) -> impl Future<Output = Result<Response<IncomingBody>>>
pub fn send_request(
&mut self,
req: Request<B>
) -> impl Future<Output = Result<Response<IncomingBody>>>
Sends a Request
on the associated connection.
Returns a future that if successful, yields the Response
.
Note
There are some key differences in what automatic things the Client
does for you that will not be done here:
Client
requires absolute-formUri
s, since the scheme and authority are needed to connect. They aren’t required here.- Since the
Client
requires absolute-formUri
s, it can add theHost
header based on it. You must add aHost
header yourself before calling this method. - Since absolute-form
Uri
s are not required, if received, they will be serialized as-is.