Package org.mockserver.codec
Class MultipartFormDataDecoder
java.lang.Object
org.mockserver.codec.MultipartFormDataDecoder
Decodes a
multipart/form-data request body into field-level
Parameters maps that can be matched the same way form parameters are.
Returns three multi-valued maps keyed by part field name:
fields— part values (text value or file bytes as a UTF-8 string)filenames— filenames of file partspartContentTypes— part-level content types
HttpPostMultipartRequestDecoder; no additional
dependency is introduced.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImmutable holder for the three field-level views of a decoded multipart body. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecodes the supplied body bytes using the boundary from the suppliedContent-Typeheader value.
-
Constructor Details
-
MultipartFormDataDecoder
public MultipartFormDataDecoder()
-
-
Method Details
-
decode
Decodes the supplied body bytes using the boundary from the suppliedContent-Typeheader value.- Parameters:
contentTypeHeader- the full request Content-Type header (must contain a boundary)body- the raw request body bytes- Returns:
- the decoded multipart parts, or
nullif the body is not multipart/form-data or cannot be parsed
-