Trait oauth_client::RequestBuilder
source · [−]pub trait RequestBuilder: Debug {
type ReturnValue;
type ClientBuilder;
fn new(method: Method, url: &str, client: &Self::ClientBuilder) -> Self;
fn body(self, b: String) -> Self;
fn header<K, V>(self, key: K, val: V) -> Self
where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>;
fn send(self) -> Result<Self::ReturnValue, Error>
where
Self: Sized;
}
Expand description
A generic request builder. Allows you to use any HTTP client.
See DefaultRequestBuilder
for one that uses reqwest::Client
.
Required Associated Types
type ReturnValue
type ReturnValue
Generic return value allows you to return a future, allowing the possibility
of using this library in async
environments.
type ClientBuilder
type ClientBuilder
This is useful for reusing existing connection pools.
Required Methods
fn new(method: Method, url: &str, client: &Self::ClientBuilder) -> Self
fn new(method: Method, url: &str, client: &Self::ClientBuilder) -> Self
Construct the request builder
fn header<K, V>(self, key: K, val: V) -> Self where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
fn header<K, V>(self, key: K, val: V) -> Self where
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
<HeaderValue as TryFrom<V>>::Error: Into<Error>,
Set a header
Implementors
sourceimpl RequestBuilder for DefaultRequestBuilder
Available on crate feature reqwest-blocking
only.
impl RequestBuilder for DefaultRequestBuilder
Available on crate feature
reqwest-blocking
only.