Class IncomingRequest
java.lang.Object
org.springframework.data.rest.webmvc.IncomingRequest
Value object to wrap a
ServerHttpRequest
to provide a slightly more abstract API to find out about the
request method.- Author:
- Oliver Gierke
-
Constructor Summary
ConstructorDescriptionIncomingRequest
(ServerHttpRequest request) Creates a newIncomingRequest
fromServerHttpRequest
. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Returns the body of the request.Returns the underlyingServerHttpRequest
.boolean
Returns whether the request is a PATCH request with a payload of typeRestMediaTypes.MERGE_PATCH_JSON
.boolean
Returns whether the request is a PATCH request with a payload of typeRestMediaTypes.JSON_PATCH_JSON
.boolean
Returns whether the request is a PATCH request.
-
Constructor Details
-
IncomingRequest
Creates a newIncomingRequest
fromServerHttpRequest
.- 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 typeRestMediaTypes.JSON_PATCH_JSON
.- Returns:
-
isJsonMergePatchRequest
public boolean isJsonMergePatchRequest()Returns whether the request is a PATCH request with a payload of typeRestMediaTypes.MERGE_PATCH_JSON
.- Returns:
-
getBody
Returns the body of the request.- Returns:
- will never be null.
- Throws:
IOException
-
getServerHttpRequest
Returns the underlyingServerHttpRequest
.- Returns:
- will never be null.
-