pub struct HttpRequest {
pub method: String,
pub url: Url,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
}Expand description
An outgoing HTTP request.
Fields§
§method: String§url: Url§headers: Vec<(String, String)>§body: Vec<u8>Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn to_http_10_vec(&self) -> Vec<u8> ⓘ
pub fn to_http_10_vec(&self) -> Vec<u8> ⓘ
Serialises this request as an HTTP/1.0 message; Content-Length is
regenerated from the body and any existing copy is dropped.
Source§impl HttpRequest
impl HttpRequest
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn to_http_11_vec(&self) -> Vec<u8> ⓘ
pub fn to_http_11_vec(&self) -> Vec<u8> ⓘ
Serialises this request as an HTTP/1.1 message; Content-Length
is regenerated from the body and any existing copy is dropped.
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