Trait isahc::RequestExt [−][src]
Extension methods on an HTTP request.
Required methods
fn to_builder(&self) -> Builder
[src]
Create a new request builder with the method, URI, and headers cloned from this request.
Note that third-party extensions are not cloned.
fn send(self) -> Result<Response<Body>, Error> where
T: Into<Body>,
[src]
T: Into<Body>,
Send the HTTP request synchronously using the default client.
This is a convenience method that is equivalent to
send
.
Examples
use isahc::prelude::*; let response = Request::post("https://httpbin.org/post") .header("Content-Type", "application/json") .body(r#"{ "speed": "fast", "cool_name": true }"#)? .send()?;
fn send_async(self) -> ResponseFuture<'static>ⓘNotable traits for ResponseFuture<'_>
impl Future for ResponseFuture<'_> type Output = Result<Response<Body>, Error>;
where
T: Into<Body>,
[src]
Notable traits for ResponseFuture<'_>
impl Future for ResponseFuture<'_> type Output = Result<Response<Body>, Error>;
T: Into<Body>,
Sends the HTTP request asynchronously using the default client.
This is a convenience method that is equivalent to
send_async
.
Implementations on Foreign Types
impl<T> RequestExt<T> for Request<T>
[src]
fn to_builder(&self) -> Builder
[src]
fn send(self) -> Result<Response<Body>, Error> where
T: Into<Body>,
[src]
T: Into<Body>,
fn send_async(self) -> ResponseFuture<'static>ⓘNotable traits for ResponseFuture<'_>
impl Future for ResponseFuture<'_> type Output = Result<Response<Body>, Error>;
where
T: Into<Body>,
[src]
Notable traits for ResponseFuture<'_>
impl Future for ResponseFuture<'_> type Output = Result<Response<Body>, Error>;
T: Into<Body>,