pub struct Request { /* private fields */ }Expand description
An HTTP request to send.
Implementations§
Source§impl Request
impl Request
Sourcepub fn method(self, method: impl Into<String>) -> Request
pub fn method(self, method: impl Into<String>) -> Request
The HTTP method. Without one it’s GET, or POST if there’s a body.
pub fn header( self, name: impl Into<String>, value: impl Into<String>, ) -> Request
pub fn body(self, body: impl Into<Vec<u8>>) -> Request
Source§impl Request
impl Request
Sourcepub async fn send_async(&self) -> Result<Response>
pub async fn send_async(&self) -> Result<Response>
Request::send without blocking: other tasks keep running while the
request connects. Requires the async feature; see crate::task.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Request
impl Freeze for Request
impl Move for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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