- All Known Subinterfaces:
WebResponseBody
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 Summary
Modifier and TypeMethodDescriptiondefault ResponseBody
Transforms the payload publisher to subscribe to the specified publisher after payload publisher completion.default ResponseBody
Transforms the payload publisher to subscribe to the specified publisher before subscribing to the payload publisher.raw()
Returns a raw payload consumer.string()
Returns a string payload consumer.Transforms the payload publisher.
-
Method Details
-
transform
ResponseBody transform(Function<Publisher<ByteBuf>, Publisher<ByteBuf>> transformer) throws IllegalStateExceptionTransforms 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
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
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
InboundData<ByteBuf> raw()Returns a raw payload consumer.
- Returns:
- the raw data
-
string
Returns a string payload consumer.
- Returns:
- the string data
- Throws:
IllegalStateException
-