Create a new Multipart instance
The parts to include in the multipart
Optional
boundary: string | Uint8Array = ...The multipart boundary used to separate the parts. Randomly generated if not provided
Optional
mediaType: string = "multipart/mixed"The media type of the multipart. Defaults to "multipart/mixed"
Readonly
headersThe headers of this multipart
Readonly
partsThe 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
The media type of the multipart
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
Static
blobStatic
formCreate Multipart from FormData. This method might be slow if the form data contains large files.
Form data
Optional
boundary: string | Uint8ArrayMultipart boundary to use to separate the parts. If not provided, a random boundary will be generated.
Static
parseParse 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
Static
parseParse multipart body data
Multipart body bytes
The multipart boundary bytes used in the body bytes to separate the parts
Optional
mediaType: stringMultipart media type to pass to the constructor
Static
part
A collection of Parts