Class MultipartData
java.lang.Object
build.serve.form.MultipartData
Parsed
multipart/form-data request body.
Obtain an instance from an inbound Request:
var multipart = MultipartData.from(exchange.request());
var file = multipart.get("avatar");
var text = multipart.get("description").map(FormPart::value).orElse("");
- Since:
- Apr-2026
- Author:
- reed.vonredwitz
-
Method Summary
Modifier and TypeMethodDescriptionstatic MultipartDatafrom(build.serve.foundation.Request request) Parses multipart form data from the givenRequest.Returns the first part with the given name, or empty if absent.Returns all parts with the given name.static MultipartDataParses multipart form data from raw bytes with the given boundary.parts()Returns all parts in this multipart body.
-
Method Details
-
from
Parses multipart form data from the givenRequest.Reads the
Content-Typeheader to extract the boundary.- Parameters:
request- the inbound request- Returns:
- the parsed
MultipartData - Throws:
IllegalArgumentException- if the Content-Type header is missing or has no boundary
-
parse
Parses multipart form data from raw bytes with the given boundary.- Parameters:
body- the raw multipart bodyboundary- the multipart boundary string- Returns:
- the parsed
MultipartData
-
get
-
getAll
-
parts
-