Interface HttpClient


public interface HttpClient
A generic interface for sending HTTP requests and getting responses.
  • Method Details

    • send

      Mono<HttpResponse> send(HttpRequest request)
      Send the provided request asynchronously.
      Parameters:
      request - The HTTP request to send.
      Returns:
      A Mono that emits the response asynchronously.
    • send

      default Mono<HttpResponse> send(HttpRequest request, Context context)
      Sends the provided request asynchronously with contextual information.
      Parameters:
      request - The HTTP request to send.
      context - Contextual information about the request.
      Returns:
      A Mono that emits the response asynchronously.
    • sendSync

      default HttpResponse sendSync(HttpRequest request, Context context)
      Sends the provided request synchronously with contextual information.
      Parameters:
      request - The HTTP request to send.
      context - Contextual information about the request.
      Returns:
      The response.
    • createDefault

      static HttpClient createDefault()
      Creates a new HttpClient instance.
      Returns:
      A new HttpClient instance.
    • createDefault

      static HttpClient createDefault(HttpClientOptions clientOptions)
      Creates a new HttpClient instance.
      Parameters:
      clientOptions - Configuration options applied to the created HttpClient.
      Returns:
      A new HttpClient instance.