pub struct RequestBuilder<'a, S, Response> { /* private fields */ }Expand description
A builder to construct the properties of a Request.
Constructed using HttpClientExt.
Implementations§
Source§impl<S, Body> RequestBuilder<'_, S, Response<Body>>
impl<S, Body> RequestBuilder<'_, S, Response<Body>>
Sourcepub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: IntoHeaderName,
V: IntoHeaderValue,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: IntoHeaderName,
V: IntoHeaderValue,
Add a Header to this Request.
Sourcepub fn typed_header<H>(self, header: H) -> Selfwhere
H: HeaderEncode,
pub fn typed_header<H>(self, header: H) -> Selfwhere
H: HeaderEncode,
Add a typed HeaderEncode to this Request.
Sourcepub fn overwrite_header<K, V>(self, key: K, value: V) -> Selfwhere
K: IntoHeaderName,
V: IntoHeaderValue,
pub fn overwrite_header<K, V>(self, key: K, value: V) -> Selfwhere
K: IntoHeaderName,
V: IntoHeaderValue,
Overwrite a Header to this Request.
Sourcepub fn overwrite_typed_header<H>(self, header: H) -> Selfwhere
H: HeaderEncode,
pub fn overwrite_typed_header<H>(self, header: H) -> Selfwhere
H: HeaderEncode,
Overwrite a typed HeaderEncode to this Request.
Sourcepub fn auth(self, credentials: impl Credentials) -> Self
pub fn auth(self, credentials: impl Credentials) -> Self
Enable HTTP authentication.
Sourcepub fn extension<T>(self, extension: T) -> Selfwhere
T: Extension,
pub fn extension<T>(self, extension: T) -> Selfwhere
T: Extension,
Adds an extension to this builder
Sourcepub fn extensions(&self) -> Option<&Extensions>
pub fn extensions(&self) -> Option<&Extensions>
Get access to the underlying Extensions
This function will return None if Extensions are not available,
or if this builder is in an error state
Sourcepub fn multipart(self, form: Form) -> Self
Available on crate feature multipart only.
pub fn multipart(self, form: Form) -> Self
multipart only.Set a multipart::Form as the body of this
Request.
Sets the Content-Type header to
multipart/form-data; boundary={boundary} and, when every part has a
known size, the Content-Length header. An existing Content-Type
header is overwritten.
Sourcepub fn octet_stream<T: Into<Bytes>>(self, bytes: T) -> Self
pub fn octet_stream<T: Into<Bytes>>(self, bytes: T) -> Self
Sourcepub async fn try_into_request(self) -> Result<Request, BoxError>
pub async fn try_into_request(self) -> Result<Request, BoxError>
Trait Implementations§
Auto Trait Implementations§
impl<'a, S, Response> !RefUnwindSafe for RequestBuilder<'a, S, Response>
impl<'a, S, Response> !UnwindSafe for RequestBuilder<'a, S, Response>
impl<'a, S, Response> Freeze for RequestBuilder<'a, S, Response>
impl<'a, S, Response> Send for RequestBuilder<'a, S, Response>where
S: Sync,
impl<'a, S, Response> Sync for RequestBuilder<'a, S, Response>where
S: Sync,
impl<'a, S, Response> Unpin for RequestBuilder<'a, S, Response>
impl<'a, S, Response> UnsafeUnpin for RequestBuilder<'a, S, Response>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more