Interface RawHttpClient

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DefaultHttpClient

public interface RawHttpClient extends Closeable
HTTP client that allows sending "raw" requests with a ByteBody for the request and response body.
Since:
4.7.0
Author:
Jonas Konrad
  • Method Details

    • exchange

      Send a raw request.
      Parameters:
      request - The request metadata (method, URI, headers). The body of this object is ignored
      requestBody - The request body bytes. null is equivalent to an empty body. The ownership of the body immediately transfers to the client, i.e. the client will always call CloseableByteBody.close() on the body even if there is an error before the request is sent.
      blockedThread - The thread that is blocked waiting for this request. This is used for deadlock detection. Optional parameter.
      Returns:
      A mono that will contain the response to this request. This response will usually be a ByteBodyHttpResponse, unless a filter replaced it.
    • create

      static RawHttpClient create(@Nullable @Nullable URI url)
      Create a new RawHttpClient. Note that this method should only be used outside the context of a Micronaut application. The returned RawHttpClient is not subject to dependency injection. The creator is responsible for closing the client to avoid leaking connections. Within a Micronaut application use Inject to inject a client instead.
      Parameters:
      url - The base URL
      Returns:
      The client
    • create

      Create a new RawHttpClient with the specified configuration. Note that this method should only be used outside the context of an application. Within Micronaut use Inject to inject a client instead
      Parameters:
      url - The base URL
      configuration - the client configuration
      Returns:
      The client