- All Known Subinterfaces:
WebRequestBody
Represents the payload body of a client request in a server exchange.
The request body basically provides multiple ways to consume the request payload depending on the request content type.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
RequestBody.Multipart<A extends Part>
A multipart/form-data consumer as defined by RFC 7578.static interface
An application/x-www-form-urlencoded data consumer as defined by application/x-www-form-urlencoded. -
Method Summary
Modifier and TypeMethodDescriptiondefault RequestBody
Transforms the payload publisher to subscribe to the specified publisher after payload publisher completion.default RequestBody
Transforms the payload publisher to subscribe to the specified publisher before subscribing to the payload publisher.RequestBody.Multipart
<? extends Part> Returns a multipart/form-data payload consumer.raw()
Returns a raw payload consumer.string()
Returns a string payload consumer.Transforms the payload publisher.Returns an application/x-www-form-urlencoded payload consumer.
-
Method Details
-
transform
RequestBody transform(Function<Publisher<ByteBuf>, Publisher<ByteBuf>> transformer) throws IllegalStateExceptionTransforms the payload publisher.
This can be used in an exchange interceptor in order to decorate the request data publisher.
- Parameters:
transformer
- a request payload publisher transformer- Returns:
- the request body
- Throws:
IllegalStateException
- if the request body data publisher has 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 request body is actually sent.
- Parameters:
before
- the publisher to subscribe before the request body publisher- Returns:
- the request body
-
after
Transforms the payload publisher to subscribe to the specified publisher after payload publisher completion.
This basically allows to perform actions after the request body has been sent.
- Parameters:
after
- the publisher to subscribe before the request body publisher- Returns:
- the request body
-
raw
Returns a raw payload consumer.
- Returns:
- the raw data
- Throws:
IllegalStateException
- if the payload has already been consumed using another decoder
-
string
Returns a string payload consumer.
- Returns:
- the string data
- Throws:
IllegalStateException
- if the payload has already been consumed using another decoder
-
multipart
Returns a multipart/form-data payload consumer.
- Returns:
- body a multipart/form-data payload consumer
- Throws:
IllegalStateException
- if the payload has already been consumed using another decoder
-
urlEncoded
Returns an application/x-www-form-urlencoded payload consumer.
- Returns:
- body an application/x-www-form-urlencoded payload consumer
- Throws:
IllegalStateException
- if the payload has already been consumed using another decoder
-