[][src]Trait isahc::RequestExt

pub trait RequestExt<T> {
    fn send(self) -> Result<Response<Body>, Error>
    where
        T: Into<Body>
;
fn send_async(self) -> ResponseFuture<'static>
    where
        T: Into<Body>
; }

Extension methods on an HTTP request.

Required methods

fn send(self) -> Result<Response<Body>, Error> where
    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()?;

Important traits for ResponseFuture<'_>
fn send_async(self) -> ResponseFuture<'static> where
    T: Into<Body>, 

Sends the HTTP request asynchronously using the default client.

This is a convenience method that is equivalent to send_async.

Loading content...

Implementors

impl<T> RequestExt<T> for Request<T>[src]

Loading content...