- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionTransforms the payload publisher to subscribe to the specified publisher after payload publisher completion.Transforms the payload publisher to subscribe to the specified publisher before subscribing to the payload publisher.<T> InboundDataDecoder
<T> Returns a decoder to decode the payload to the specified type based on the content type of the response.<T> InboundDataDecoder
<T> Returns a decoder to decode the payload to the specified type based on the content type of the response.Transforms the payload publisher.Methods inherited from interface io.inverno.mod.http.client.ResponseBody
raw, string
-
Method Details
-
transform
WebResponseBody transform(Function<Publisher<ByteBuf>, Publisher<ByteBuf>> transformer) throws IllegalStateExceptionDescription 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 interfaceResponseBody
- Parameters:
transformer
- a payload publisher transformer- Returns:
- the response body
- Throws:
IllegalStateException
- if the response payload publisher has already been subscribed
-
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 interfaceResponseBody
- Parameters:
before
- the publisher to subscribe before the response body publisher- Returns:
- the response body
-
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 interfaceResponseBody
- Parameters:
after
- the publisher to subscribe before the response body publisher- Returns:
- the response body
-
decoder
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
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
-