spring-framework / org.springframework.web.servlet.mvc.method.annotation / RequestBodyAdvice / handleEmptyBody

handleEmptyBody

@Nullable abstract fun handleEmptyBody(@Nullable body: Any, inputMessage: HttpInputMessage, parameter: MethodParameter, targetType: Type, converterType: Class<out HttpMessageConverter<*>>): Any

Invoked second (and last) if the body is empty.

Parameters

body - usually set to null before the first advice is called

inputMessage - the request

parameter - the method parameter

targetType - the target type, not necessarily the same as the method parameter type, e.g. for HttpEntity<String>.

converterType - the selected converter type

Return
the value to use or null which may then raise an HttpMessageNotReadableException if the argument is required.