- All Known Subinterfaces:
WebRequestBody
public interface RequestBody
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
Modifier 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 TypeMethodDescriptionRequestBody.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
-
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
-