Interface WebRequestBody

All Superinterfaces:
RequestBody

public interface WebRequestBody extends RequestBody

A request body with payload decoding support.

Implementors should rely on MediaTypeConverter to decode a payload based on the content type of the request.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • transform

      Description copied from interface: RequestBody

      Transforms the payload publisher.

      This can be used in an exchange interceptor in order to decorate the request data publisher.

      Specified by:
      transform in interface RequestBody
      Parameters:
      transformer - a request payload publisher transformer
      Returns:
      the request body
    • before

      WebRequestBody before(Mono<Void> before)
      Description copied from interface: RequestBody

      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.

      Specified by:
      before in interface RequestBody
      Parameters:
      before - the publisher to subscribe before the request body publisher
      Returns:
      the request body
    • after

      WebRequestBody after(Mono<Void> after)
      Description copied from interface: RequestBody

      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.

      Specified by:
      after in interface RequestBody
      Parameters:
      after - the publisher to subscribe before the request body publisher
      Returns:
      the request body
    • decoder

      <A> InboundDataDecoder<A> decoder(Class<A> type)

      Returns a decoder to decode the payload to the specified type based on the content type of the request.

      Type Parameters:
      A - the decoded type
      Parameters:
      type - a class of A
      Returns:
      a decoder
    • decoder

      <A> InboundDataDecoder<A> decoder(Type type)

      Returns a decoder to decode the payload to the specified type based on the content type of the request.

      Type Parameters:
      A - the decoded type
      Parameters:
      type - the decoded type
      Returns:
      a decoder
    • multipart

      Description copied from interface: RequestBody

      Returns a multipart/form-data payload consumer.

      Specified by:
      multipart in interface RequestBody
      Returns:
      body a multipart/form-data payload consumer
      Throws:
      IllegalStateException - if the payload has already been consumed using another decoder