RequestBodyResolver class final
Resolves method parameters annotated with @RequestBody.
The RequestBodyResolver uses the configured HttpMessageConverters to
deserialize the HTTP request body into the target Dart object, based on
the request's Content-Type header.
Example
@PostMapping('/users')
Future<ResponseBody<User>> createUser(@RequestBody User user) async {
// `user` is automatically deserialized from JSON (or another supported format)
}
Supported Types
- JSON (
application/json) - XML (
application/xml) - Form data, text, or binary (depending on available converters)
Error Handling
Throws:
- HttpMediaTypeNotSupportedException if no suitable converter is found
- HttpMessageNotReadableException if deserialization fails
- Implemented types
Constructors
- RequestBodyResolver()
-
Resolves method parameters annotated with
@RequestBody.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
ServerHttpRequest request, Parameter parameter, ResolverContext context) → Future< Object?> -
Resolves the actual value for the method parameter from the current HTTP request.
override
-
supports(
Parameter parameter) → bool -
Determines whether this resolver can handle the specified method parameter.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited