Interface HttpClient.ResponseReceiver<S extends HttpClient.ResponseReceiver<?>>

All Superinterfaces:
HttpClient.UriConfiguration<S>
All Known Subinterfaces:
HttpClient.RequestSender
Enclosing class:
HttpClient

public static interface HttpClient.ResponseReceiver<S extends HttpClient.ResponseReceiver<?>> extends HttpClient.UriConfiguration<S>
A response extractor for this configured HttpClient. Since HttpClient.ResponseReceiver API returns Flux or Mono, requesting is always deferred to Publisher.subscribe(Subscriber).
  • Method Details

    • response

      Return the response status and headers as HttpClientResponse

      Will automatically close the response if necessary.

      Note: Will automatically close low-level network connection after returned Mono terminates or is being cancelled.

      Returns:
      the response status and headers as HttpClientResponse
    • response

      <V> Flux<V> response(BiFunction<? super HttpClientResponse,? super ByteBufFlux,? extends Publisher<V>> receiver)
      Extract a response flux from the given HttpClientResponse and body ByteBufFlux.

      Will automatically close the response if necessary after the returned Flux terminates or is being cancelled.

      Type Parameters:
      V - the extracted flux type
      Parameters:
      receiver - extracting receiver
      Returns:
      a Flux forwarding the returned Publisher sequence
    • responseConnection

      <V> Flux<V> responseConnection(BiFunction<? super HttpClientResponse,? super Connection,? extends Publisher<V>> receiver)
      Extract a response flux from the given HttpClientResponse and underlying Connection.

      The connection will not automatically DisposableChannel.dispose() and manual interaction with this method might be necessary if the remote never terminates itself.

      Type Parameters:
      V - the extracted flux type
      Parameters:
      receiver - extracting receiver
      Returns:
      a Flux forwarding the returned Publisher sequence
    • responseContent

      ByteBufFlux responseContent()
      Return the response body chunks as ByteBufFlux.

      Will automatically close the response if necessary after the returned Flux terminates or is being cancelled.

      Returns:
      the response body chunks as ByteBufFlux.
    • responseSingle

      <V> Mono<V> responseSingle(BiFunction<? super HttpClientResponse,? super ByteBufMono,? extends Mono<V>> receiver)
      Extract a response mono from the given HttpClientResponse and aggregated body ByteBufMono.

      Will automatically close the response if necessary after the returned Mono terminates or is being cancelled.

      Type Parameters:
      V - the extracted mono type
      Parameters:
      receiver - extracting receiver
      Returns:
      a Mono forwarding the returned Mono result