pub trait RequestBuilder: Debug {
    type ReturnValue;
    type ClientBuilder;

    fn new(method: Method, url: &str, client: &Self::ClientBuilder) -> Self;
    fn body(self, b: String) -> Self;
    fn header<K, V>(self, key: K, val: V) -> Self
    where
        HeaderName: TryFrom<K>,
        HeaderValue: TryFrom<V>,
        <HeaderName as TryFrom<K>>::Error: Into<Error>,
        <HeaderValue as TryFrom<V>>::Error: Into<Error>
; fn send(self) -> Result<Self::ReturnValue, Error>
    where
        Self: Sized
; }
Expand description

A generic request builder. Allows you to use any HTTP client. See DefaultRequestBuilder for one that uses reqwest::Client.

Required Associated Types

Generic return value allows you to return a future, allowing the possibility of using this library in async environments.

This is useful for reusing existing connection pools.

Required Methods

Construct the request builder

Set the body

Set a header

A build-like function that also sends the request

Implementors