Skip to content

Function: createMultipartRequestBody()

ts
function createMultipartRequestBody(input): Promise<MultipartRequestBody>;

Defined in: src/core/formData/multipartRequest.ts:232

A multipart body for input, streaming it where the runtime allows.

Content that is already in memory — a File, Blob, Uint8Array or string — goes into a FormData, which every runtime handles and which lets the platform read a File off disk without loading it.

Streaming content is sent as a stream where request streaming exists (Node, Chromium over HTTP/2) and is otherwise collected into a Blob first, because Firefox and Safari cannot send a stream at all. Collecting is the fallback rather than the default, so nothing silently buffers a large upload on a runtime that could have streamed it.

Parameters

ParameterType
input| AttachmentInput | AttachmentInput[]

Returns

Promise&lt;MultipartRequestBody>