pub struct HttpRequest {
pub url: String,
pub method: HttpMethod,
pub headers: HashMap<String, String>,
pub body: Option<Vec<u8>>,
pub timeout_ms: Option<u64>,
}Expand description
HTTP request configuration.
Fields§
§url: StringRequest URL
method: HttpMethodHTTP method
headers: HashMap<String, String>Request headers
body: Option<Vec<u8>>Request body (for POST/PUT)
timeout_ms: Option<u64>Timeout in milliseconds
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Set a header.
Sourcepub const fn with_timeout(self, ms: u64) -> Self
pub const fn with_timeout(self, ms: u64) -> Self
Set timeout in milliseconds.
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
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 moreAuto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl UnwindSafe for HttpRequest
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