Package io.micronaut.servlet.http
Interface BodyBuilder
- All Known Implementing Classes:
DefaultBodyBuilder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
API to Read the Body of an HTTP Request where the body is supplied as an InputStream.
- Since:
- 4.0.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescription@Nullable Object
buildBody
(@NonNull Callable<InputStream> bodySupplier, @NonNull io.micronaut.http.HttpRequest<?> request) static boolean
isFormSubmission
(io.micronaut.http.MediaType contentType)
-
Method Details
-
isFormSubmission
static boolean isFormSubmission(io.micronaut.http.MediaType contentType) - Parameters:
contentType
- Content Type- Returns:
- returns true if the content type is either application/x-www-form-urlencoded or multipart/form-data
-
buildBody
@Nullable @Nullable Object buildBody(@NonNull @NonNull Callable<InputStream> bodySupplier, @NonNull @NonNull io.micronaut.http.HttpRequest<?> request) - Parameters:
bodySupplier
- The HTTP Body supplied as an Input Streamrequest
- The HTTP Request- Returns:
- An object representing the HTTP body or null
-