Trait opentelemetry_http::HttpClient[][src]

pub trait HttpClient: Debug + Send + Sync {
    #[must_use]
    fn send<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Vec<u8>>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

A minimal interface necessary for export spans over HTTP.

Users sometime choose HTTP clients that relay on a certain async runtime. This trait allows users to bring their choice of HTTP client.

Required methods

#[must_use]
fn send<'life0, 'async_trait>(
    &'life0 self,
    request: Request<Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>, HttpError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Send the specified HTTP request

Returns the HTTP response including the status code and body.

Returns an error if it can’t connect to the server or the request could not be completed, e.g. because of a timeout, infinite redirects, or a loss of connection.

Loading content...

Implementors

Loading content...