pub struct HttpRequestOptions {Show 13 fields
pub method: String,
pub url: String,
pub params: Option<HashMap<String, String>>,
pub headers: Option<HashMap<String, String>>,
pub body: Option<Value>,
pub follow_redirects: Option<bool>,
pub max_redirections: Option<u32>,
pub connect_timeout: Option<u64>,
pub read_timeout: Option<u64>,
pub timeout: Option<u64>,
pub allow_compression: Option<bool>,
pub body_type: Option<BodyType>,
pub response_type: Option<ResponseType>,
}
Expand description
The configuration object of an HTTP request
Fields§
§method: String
The request method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT or TRACE)
url: String
The request URL
params: Option<HashMap<String, String>>
The request query params
headers: Option<HashMap<String, String>>
The request headers
body: Option<Value>
The request body
follow_redirects: Option<bool>
Whether to follow redirects or not
max_redirections: Option<u32>
Max number of redirections to follow
connect_timeout: Option<u64>
Connect timeout for the request
read_timeout: Option<u64>
Read timeout for the request
timeout: Option<u64>
Timeout for the whole request
allow_compression: Option<bool>
Whether the request will announce that it accepts compression
body_type: Option<BodyType>
The body type (defaults to Auto)
response_type: Option<ResponseType>
The response type (defaults to Json)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HttpRequestOptions
impl<'de> Deserialize<'de> for HttpRequestOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HttpRequestOptions
impl RefUnwindSafe for HttpRequestOptions
impl Send for HttpRequestOptions
impl Sync for HttpRequestOptions
impl Unpin for HttpRequestOptions
impl UnwindSafe for HttpRequestOptions
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
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