Class IncomingRequest

java.lang.Object
org.springframework.data.rest.webmvc.IncomingRequest

public class IncomingRequest extends Object
Value object to wrap a ServerHttpRequest to provide a slightly more abstract API to find out about the request method.
Author:
Oliver Gierke
  • Constructor Details

    • IncomingRequest

      public IncomingRequest(org.springframework.http.server.ServerHttpRequest request)
      Creates a new IncomingRequest from ServerHttpRequest.
      Parameters:
      request - must not be null.
  • Method Details

    • isPatchRequest

      public boolean isPatchRequest()
      Returns whether the request is a PATCH request.
      Returns:
    • isJsonPatchRequest

      public boolean isJsonPatchRequest()
      Returns whether the request is a PATCH request with a payload of type RestMediaTypes.JSON_PATCH_JSON.
      Returns:
    • isJsonMergePatchRequest

      public boolean isJsonMergePatchRequest()
      Returns whether the request is a PATCH request with a payload of type RestMediaTypes.MERGE_PATCH_JSON.
      Returns:
    • getBody

      public InputStream getBody() throws IOException
      Returns the body of the request.
      Returns:
      will never be null.
      Throws:
      IOException
    • getServerHttpRequest

      public org.springframework.http.server.ServerHttpRequest getServerHttpRequest()
      Returns the underlying ServerHttpRequest.
      Returns:
      will never be null.