pub struct HttpRequest<'a> {
pub method: HttpMethod,
pub url: &'a str,
pub headers: Vec<(&'static str, String)>,
pub body: &'a [u8],
pub long_running: bool,
}Expand description
A request for HttpClient::send.
Fields§
§method: HttpMethodRequest method.
url: &'a strAbsolute URL.
headers: Vec<(&'static str, String)>Extra request headers, in order.
body: &'a [u8]Request body; empty for GET and HEAD.
long_running: boolWhether the request may run longer than the client’s usual whole-request timeout (a large download or upload).
Implementations§
Source§impl<'a> HttpRequest<'a>
impl<'a> HttpRequest<'a>
Sourcepub fn new(method: HttpMethod, url: &'a str) -> Self
pub fn new(method: HttpMethod, url: &'a str) -> Self
A request with no headers and no body.
Sourcepub fn long_running(self) -> Self
pub fn long_running(self) -> Self
Mark the request as a long transfer (see Self::long_running).
Trait Implementations§
Source§impl<'a> Clone for HttpRequest<'a>
impl<'a> Clone for HttpRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for HttpRequest<'a>
impl<'a> RefUnwindSafe for HttpRequest<'a>
impl<'a> Send for HttpRequest<'a>
impl<'a> Sync for HttpRequest<'a>
impl<'a> Unpin for HttpRequest<'a>
impl<'a> UnsafeUnpin for HttpRequest<'a>
impl<'a> UnwindSafe for HttpRequest<'a>
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