Module io.inverno.mod.web.server
Annotation Interface Body
Binds the payload of a request to a web route method parameter.
The type of the annotated parameter can either be:
ByteBuf
,Mono<ByteBuf>
,Flux<ByteBuf>
orPublisher<ByteBuf>
to consume raw dataMono<
,Parameter
>Flux<Parameter>
orPublisher<Parameter>
to consume URL encoded form dataMono<T>
,Flux<T>
orPublisher<T>
where typeT
is a super type ofWebPart
to consume multipart form dataT
,Mono<T>
,Flux<T>
orPublisher<T>
where typeT
is neither aByteBuf
, nor aParameter
, nor a super type ofWebPart
to consume decoded data based on the content type of the request.
An encoded request payload is decoded using one of the MediaTypeConverter
injected in the web server module and corresponding to the content type of the request.
@WebRoute( method = Method.POST, consumes = MediaTypes.APPLICATION_JSON )
public void create(Book book) {
...
}
@WebRoute( method = Method.POST, consumes = MediaTypes.APPLICATION_X_NDJSON )
public void createReactive(Flux<Book> book) {
...
}
This annotation can't be used in conjunction with @FormParam
.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also: