[−][src]Struct minreq::Request
An HTTP request.
Methods
impl Request
[src]
pub fn new<T: Into<URL>>(method: Method, url: T) -> Request
[src]
Creates a new HTTP Request
.
This is only the request's data, it is not sent yet. For
sending the request, see send
.
pub fn with_header<T: Into<String>, U: Into<String>>(
self,
key: T,
value: U
) -> Request
[src]
self,
key: T,
value: U
) -> Request
Adds a header to the request this is called on. Use this function to add headers to your requests.
pub fn with_body<T: Into<String>>(self, body: T) -> Request
[src]
Sets the request body.
pub fn with_timeout(self, timeout: u64) -> Request
[src]
Sets the request timeout.
pub fn send(self) -> Result<Response, Error>
[src]
Sends this request to the host.
Auto Trait Implementations
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
impl RefUnwindSafe for Request
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,