Interface RequestBody

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:
  • Method Details

    • transform

      Transforms 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

      default RequestBody 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 request body is actually sent.

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

      default RequestBody 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 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

      RequestBody.Multipart<? extends Part> multipart() throws IllegalStateException

      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