Interface ResponseBody

All Known Subinterfaces:
WebResponseBody

public interface ResponseBody

Represents the response payload received by a client from a server in a client exchange.

The response body basically provides multiple ways to consume the payload depending on the response content type.

Since:
1.6
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • transform

      Transforms the payload publisher.

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

      Parameters:
      transformer - a payload publisher transformer
      Returns:
      the response body
      Throws:
      IllegalStateException - if the response payload publisher has already been subscribed
    • before

      default ResponseBody before(Mono<Void> before)

      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.

      Parameters:
      before - the publisher to subscribe before the response body publisher
      Returns:
      the response body
    • after

      default ResponseBody after(Mono<Void> after)

      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.

      Parameters:
      after - the publisher to subscribe before the response body publisher
      Returns:
      the response body
    • raw

      Returns a raw payload consumer.

      Returns:
      the raw data
    • string

      Returns a string payload consumer.

      Returns:
      the string data
      Throws:
      IllegalStateException