Class MultipartBody


public class MultipartBody extends Body<Parameters>
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
Each map mirrors the 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