Interface HttpSender


  • public interface HttpSender
    An abstraction for sending HTTP requests and handling responses.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    See Also:
    HttpExporter, HttpExporterBuilder
    • Method Detail

      • send

        void send​(Marshaler marshaler,
                  int contentLength,
                  java.util.function.Consumer<HttpSender.Response> onResponse,
                  java.util.function.Consumer<java.lang.Throwable> onError)
        Send an HTTP request, including any retry attempts. onResponse is called with the HTTP response, either a success response or a error response after retries. onError is called when the request could not be executed due to cancellation, connectivity problems, or timeout.
        Parameters:
        marshaler - the request body marshaler
        contentLength - the request body content length
        onResponse - the callback to invoke with the HTTP response
        onError - the callback to invoke when the HTTP request could not be executed