pub struct HttpRequest { /* private fields */ }Implementations§
Source§impl HttpRequest
impl HttpRequest
pub fn get(url: impl Into<String>) -> Self
pub fn post(url: impl Into<String>) -> Self
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Adds a request header. Duplicate names are preserved and sent in order.
pub fn body(self, body: impl Into<Vec<u8>>) -> Self
Sourcepub async fn send(self) -> Result<HttpResponse, IdeviceError>
pub async fn send(self) -> Result<HttpResponse, IdeviceError>
Sends the request, following redirects, and returns the final response.
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Auto Trait Implementations§
impl Forget for HttpRequest
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