Interface RestSupport
- All Known Implementing Classes:
RestSupportImpl
public interface RestSupport
Service which provides REST-related utilities.
- Since:
- 5.8.0
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>
getRequestBodyAs
(Class<T> type) Returns, if present, the body of the request body coerced to a given type.boolean
Is this request a HEAD?boolean
Is this request a GET?boolean
Is this request a HEAD?boolean
Is this request a HEAD?boolean
Is this request a POST?boolean
Is this request a PUT?
-
Method Details
-
isHttpGet
boolean isHttpGet()Is this request a GET?- Returns:
true
orfalse
-
isHttpPost
boolean isHttpPost()Is this request a POST?- Returns:
true
orfalse
-
isHttpHead
boolean isHttpHead()Is this request a HEAD?- Returns:
true
orfalse
-
isHttpPut
boolean isHttpPut()Is this request a PUT?- Returns:
true
orfalse
-
isHttpDelete
boolean isHttpDelete()Is this request a HEAD?- Returns:
true
orfalse
-
isHttpPatch
boolean isHttpPatch()Is this request a HEAD?- Returns:
true
orfalse
-
getRequestBodyAs
Returns, if present, the body of the request body coerced to a given type. If the body is empty, an empty Optional is returned. Coercions are done through, which uses TypeCoercer as a fallback (coercing HttpServletRequest to the target type).- Type Parameters:
T
- the type of the return value.- Parameters:
type
- the target type.- Returns:
- an
Optional
wrapping the resulting object.
-