Interface WebResponseBody

All Superinterfaces:
ResponseBody

public interface WebResponseBody extends ResponseBody

A Web response body with payload decoding support.

Implementors should rely on MediaTypeConverter to decode a payload based on the content type of the response.

Since:
1.12
Author:
Jeremy Kuhn
  • Method Details

    • transform

      Description copied from interface: ResponseBody

      Transforms the payload publisher.

      This can be used to decorate the response data publisher before it has been subscribed to.

      Specified by:
      transform in interface ResponseBody
      Parameters:
      transformer - a payload publisher transformer
      Returns:
      the response body
      Throws:
      IllegalStateException - if the response payload publisher has already been subscribed
    • before

      WebResponseBody before(Mono<Void> before)
      Description copied from interface: ResponseBody

      Transforms the payload publisher to subscribe to the specified publisher before subscribing to the payload publisher.

      This basically allows to perform actions before the response body is actually sent.

      Specified by:
      before in interface ResponseBody
      Parameters:
      before - the publisher to subscribe before the response body publisher
      Returns:
      the response body
    • after

      WebResponseBody after(Mono<Void> after)
      Description copied from interface: ResponseBody

      Transforms the payload publisher to subscribe to the specified publisher after payload publisher completion.

      This basically allows to perform actions after the response body has been sent.

      Specified by:
      after in interface ResponseBody
      Parameters:
      after - the publisher to subscribe before the response body publisher
      Returns:
      the response body
    • decoder

      <T> InboundDataDecoder<T> decoder(Class<T> type)

      Returns a decoder to decode the payload to the specified type based on the content type of the response.

      Type Parameters:
      T - the decoded type
      Parameters:
      type - a class of A
      Returns:
      a data decoder
    • decoder

      <T> InboundDataDecoder<T> decoder(Type type)

      Returns a decoder to decode the payload to the specified type based on the content type of the response.

      Type Parameters:
      T - the decoded type
      Parameters:
      type - the decoded type
      Returns:
      a data decoder