pub struct HttpOptions {
pub method: Option<String>,
pub headers: Option<HashMap<String, String>>,
pub body: Option<HttpBody>,
pub timeout: Option<u32>,
pub query_params: Option<HashMap<String, String>>,
}Fields§
§method: Option<String>§headers: Option<HashMap<String, String>>§body: Option<HttpBody>§timeout: Option<u32>§query_params: Option<HashMap<String, String>>Implementations§
Source§impl HttpOptions
impl HttpOptions
pub fn new() -> Self
pub fn method<S: Into<String>>(self, method: S) -> Self
pub fn header<K: Into<String>, V: Into<String>>(self, key: K, value: V) -> Self
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn body<S: Into<String>>(self, body: S) -> Self
pub fn body_binary(self, data: Vec<u8>) -> Self
pub fn form(self, form_data: HashMap<String, String>) -> Self
pub fn multipart(self, fields: Vec<MultipartField>) -> Self
pub fn timeout(self, timeout_ms: u32) -> Self
pub fn json<T: Serialize>(self, data: &T) -> Result<Self, HttpError>
pub fn basic_auth<U: Into<String>, P: Into<String>>( self, username: U, password: P, ) -> Self
pub fn bearer_auth<T: Into<String>>(self, token: T) -> Self
pub fn query_param<K: Into<String>, V: Into<String>>( self, key: K, value: V, ) -> Self
pub fn query_params(self, params: HashMap<String, String>) -> Self
Trait Implementations§
Source§impl Clone for HttpOptions
impl Clone for HttpOptions
Source§fn clone(&self) -> HttpOptions
fn clone(&self) -> HttpOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpOptions
impl Debug for HttpOptions
Source§impl Default for HttpOptions
impl Default for HttpOptions
Source§impl<'de> Deserialize<'de> for HttpOptions
impl<'de> Deserialize<'de> for HttpOptions
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
Source§impl PartialEq for HttpOptions
impl PartialEq for HttpOptions
Source§impl Serialize for HttpOptions
impl Serialize for HttpOptions
impl StructuralPartialEq for HttpOptions
Auto Trait Implementations§
impl Freeze for HttpOptions
impl RefUnwindSafe for HttpOptions
impl Send for HttpOptions
impl Sync for HttpOptions
impl Unpin for HttpOptions
impl UnwindSafe for HttpOptions
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