pub struct HttpRequest { /* private fields */ }Expand description
HTTP Request Builder
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn new(method: HttpMethod, url: &str) -> Self
pub fn new(method: HttpMethod, url: &str) -> Self
Create a new HTTP request
Sourcepub fn body_bytes(self, bytes: Vec<u8>) -> Self
pub fn body_bytes(self, bytes: Vec<u8>) -> Self
Set request body as bytes
Sourcepub fn follow_redirects(self, follow: bool) -> Self
pub fn follow_redirects(self, follow: bool) -> Self
Enable following redirects
Sourcepub async fn send(self) -> HttpResult<HttpResponse>
pub async fn send(self) -> HttpResult<HttpResponse>
Execute the request
Sourcepub async fn send_streaming<F>(self, on_chunk: F) -> HttpResult<HttpResponse>
pub async fn send_streaming<F>(self, on_chunk: F) -> HttpResult<HttpResponse>
Execute the request and stream the response
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 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