pub struct OutgoingRequest<B = Body> { /* private fields */ }
Available on crate feature
client
only.Expand description
Client request that can be sent to an HTTP server.
Implementations§
Source§impl OutgoingRequest<()>
impl OutgoingRequest<()>
Sourcepub fn builder<U>(
method: Method,
url: U,
) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
pub fn builder<U>(
method: Method,
url: U,
) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
Get a request builder.
Sourcepub fn get<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
pub fn get<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
Get a request builder for a GET request.
Sourcepub fn put<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
pub fn put<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
Get a request builder for a PUT request.
Sourcepub fn post<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
pub fn post<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
Get a request builder for a POST request.
Sourcepub fn delete<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
pub fn delete<U>(url: U) -> Result<OutgoingRequestBuilder, UrlParseError>where
U: IntoUrl,
Get a request builder for a DELETE request.
Source§impl<B> OutgoingRequest<B>
impl<B> OutgoingRequest<B>
Sourcepub fn deconstruct(self) -> (Url, RequestHeader, B)
pub fn deconstruct(self) -> (Url, RequestHeader, B)
Split the request into the header and body.
Sourcepub fn into_builder(self) -> (OutgoingRequestBuilder, B)
pub fn into_builder(self) -> (OutgoingRequestBuilder, B)
Deconstruct the request back into a request builder and the body.
Methods from Deref<Target = Request<B>>§
Sourcepub fn header(&self) -> &RequestHeader
pub fn header(&self) -> &RequestHeader
Get the request header.
Sourcepub fn path(&self) -> &RequestPath
pub fn path(&self) -> &RequestPath
Get the request path.
Sourcepub fn get_all_header_fields(&self) -> Iter<'_> ⓘ
pub fn get_all_header_fields(&self) -> Iter<'_> ⓘ
Get all header fields.
Sourcepub fn get_header_fields<'a, N>(&'a self, name: &'a N) -> FieldIter<'a> ⓘ
pub fn get_header_fields<'a, N>(&'a self, name: &'a N) -> FieldIter<'a> ⓘ
Get header fields corresponding to a given name.
Sourcepub fn get_header_field<'a, N>(&'a self, name: &'a N) -> Option<&'a HeaderField>
pub fn get_header_field<'a, N>(&'a self, name: &'a N) -> Option<&'a HeaderField>
Get the last header field of a given name.
Sourcepub fn get_header_field_value<'a, N>(
&'a self,
name: &'a N,
) -> Option<&'a HeaderFieldValue>
pub fn get_header_field_value<'a, N>( &'a self, name: &'a N, ) -> Option<&'a HeaderFieldValue>
Get value of the last header field with a given name.
Trait Implementations§
Auto Trait Implementations§
impl<B = Body> !Freeze for OutgoingRequest<B>
impl<B> RefUnwindSafe for OutgoingRequest<B>where
B: RefUnwindSafe,
impl<B> Send for OutgoingRequest<B>where
B: Send,
impl<B> Sync for OutgoingRequest<B>where
B: Sync,
impl<B> Unpin for OutgoingRequest<B>where
B: Unpin,
impl<B> UnwindSafe for OutgoingRequest<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more