Create a new Multipart instance
The parts to include in the multipart
Optionalboundary: string | Uint8Array<ArrayBufferLike> = ...The multipart boundary used to separate the parts. Randomly generated if not provided
OptionalmediaType: string = "multipart/mixed"The media type of the multipart. Defaults to "multipart/mixed"
ReadonlyheadersThe headers of this multipart
ReadonlypartsThe parts to include in the multipart
Get the bytes of the body of this multipart. Includes all parts separated by the boundary. Does not include the headers.
RangeError If the multipart boundary is invalid. A valid boundary is 1 to 70 characters long, does not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space
Get the boundary bytes used to separate the parts
Set the boundary bytes used to separate the parts
Create Blob from this multipart.
RangeError If the multipart boundary is invalid. A valid boundary is 1 to 70 characters long, does not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space.
Get the bytes of the headers and body of this multipart.
RangeError If the multipart boundary is invalid. A valid boundary is 1 to 70 characters long, does not end with space, and may only contain: A-Z a-z 0-9 '()+_,-./:=? and space
Create FormData from this multipart.
Only parts that have Content-Disposition set to form-data and a non-empty name will be included.
StaticblobCreate Multipart from a Blob. The boundary and media type are determined from the blob's type.
The blob
SyntaxError If the Content-Type header is missing or does not include a boundary
StaticformCreate Multipart from FormData. This method might be slow if the form data contains large files.
Form data
Optionalboundary: string | Uint8Array<ArrayBufferLike>Multipart boundary to use to separate the parts. If not provided, a random boundary will be generated.
StaticparseParse multipart bytes (including headers). The boundary and media type are determined from the headers.
Byte representation of the multipart headers and body
SyntaxError If the Content-Type header is missing or does not include a boundary
StaticparseParse multipart body data
Multipart body bytes
The multipart boundary bytes used in the body bytes to separate the parts
OptionalmediaType: stringMultipart media type to pass to the constructor
StaticpartCreate Multipart from a Part. The boundary and media type are determined from the part's headers.
The part
SyntaxError If the Content-Type header is missing or does not include a boundary
A collection of Parts