pub struct HttpClientBuilder { /* private fields */ }
Expand description

Http Client Builder.

Examples


use jsonrpsee_http_client::{HttpClientBuilder, HeaderMap, HeaderValue};

#[tokio::main]
async fn main() {
    // Build custom headers used for every submitted request.
    let mut headers = HeaderMap::new();
    headers.insert("Any-Header-You-Like", HeaderValue::from_static("42"));

    // Build client
    let client = HttpClientBuilder::default()
         .set_headers(headers)
         .build("http://localhost")
         .unwrap();

    // use client....
}

Implementations§

Sets the maximum size of a request body in bytes (default is 10 MiB).

Set request timeout (default is 60 seconds).

Set max concurrent requests.

Set which certificate store to use.

Configure the data type of the request object ID (default is number).

Max length for logging for requests and responses in number characters.

Logs bigger than this limit will be truncated.

Set a custom header passed to the server with every request (default is none).

The caller is responsible for checking that the headers do not conflict or are duplicated.

Build the HTTP client with target to connect to.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more