pub struct HttpRequest {
pub method: String,
pub url: String,
pub headers: Option<Vec<(String, String)>>,
pub body: Option<Vec<u8>>,
}Fields§
§method: String§url: String§headers: Option<Vec<(String, String)>>§body: Option<Vec<u8>>Implementations§
Source§impl HttpRequest
impl HttpRequest
pub fn new<U: Into<String>>(method: &str, url: U) -> Self
pub fn get<U: Into<String>>(url: U) -> Self
pub fn post<U: Into<String>>(url: U) -> Self
pub fn head<U: Into<String>>(url: U) -> Self
pub fn with_header(self, name: &str, value: &str) -> Self
pub fn with_headers(self, headers: Vec<(String, String)>) -> Self
pub fn with_body(self, body: Vec<u8>) -> Self
pub fn with_body_str(self, body: &str) -> Self
pub fn with_range(self, start: u64, end: Option<u64>) -> Self
pub fn with_user_agent(self, ua: &str) -> Self
pub fn with_referer(self, referer: &str) -> Self
pub fn with_accept_encoding(self, encoding: &str) -> Self
pub fn get_header(&self, name: &str) -> Option<&String>
pub fn has_range(&self) -> bool
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 (const: unstable) · 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