Multipart requests
Multipart requests combine one or more sets of data into a single body, separated by boundaries. This is commonly used to upload files.
To define a multipart request in HTTP you must set the contentType header to "multipart/form-data"
as described in the content types doc
Each property of the body represents a part of the multipart request. The name of the property is used as the name of the part. Properties in models are ordered and the order is used to determine the order of the parts in the request.
The previous example would correspond to the following HTTP request:
Default handling
By default, the Content-Type
of individual request parts is set automatically according to the type of the schema properties that describe the request parts:
Schema Property Type | Content-Type | Example |
---|---|---|
Primitive | text/plain | string , number , boolean |
Complex value or array of complex values | application/json | Address , Address[] |
bytes | application/octet-stream | bytes |
Examples
Custom Content-Type, boundary, etc.
This is currently not possible, see Issue 2419 for status.