Package org.mockserver.model
Class MultipartBody
Matches a
multipart/form-data request body at the field level.
A multipart body is treated as a set of named parts. Each part has a field name and a value, and file parts additionally carry a filename and a part-level content type. This body lets an expectation match on:
fields— field name to value patterns (text part value or file part bytes as string)filenames— field name to filename patterns (file parts only)partContentTypes— field name to part content-type patterns
ParameterBody / form-parameter matching UX:
keys and values are NottableStrings, so regular expressions and
negation (presence / absence) work exactly as they do for form parameters.
Matching uses sub-set semantics — only the specified parts are checked and
extra parts in the request are ignored.- Author:
- jamesdbloom
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartBody(List<Parameter> fields) MultipartBody(Parameter... fields) MultipartBody(Parameters fields) MultipartBody(Parameters fields, Parameters filenames, Parameters partContentTypes) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetValue()inthashCode()static MultipartBodystatic MultipartBodystatic MultipartBodymultipart(Parameters fields) withFilenames(Parameter... filenames) withFilenames(Parameters filenames) withPartContentTypes(Parameter... partContentTypes) withPartContentTypes(Parameters partContentTypes) Methods inherited from class org.mockserver.model.Body
getCharset, getContentType, getOptional, getRawBytes, getType, withOptionalMethods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
MultipartBody
-
MultipartBody
-
MultipartBody
-
MultipartBody
-
-
Method Details
-
multipart
-
multipart
-
multipart
-
withFilenames
-
withFilenames
-
withPartContentTypes
-
withPartContentTypes
-
getValue
- Specified by:
getValuein classBody<Parameters>
-
getFields
-
getFilenames
-
getPartContentTypes
-
equals
- Overrides:
equalsin classBody<Parameters>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBody<Parameters>
-