new MultipartBody
new MultipartBody()A multipart/form-data body that's encoded on every send, its files are never copied (unlike undici's FormData) Encodes the same bytes as undici's FormData, only the boundary differs
A multipart/form-data body that's encoded on every send, its files are never copied (unlike undici's FormData) Encodes the same bytes as undici's FormData, only the boundary differs
import { MultipartBody } from 'detritus-rest';append(name: string, value: any, filename?: string): voidLike FormData.append(), a blob without a filename is named after its File name or blob
appendFile(name: string, value: any, filename: string, contentType?: string): voidA file part, a stream value is read in on the first send and a non-binary one is sent as its string
encode(): { length: number; stream: ReadableStream<Uint8Array<ArrayBufferLike>> }A new stream of the body and its length, can be called for every send
resolveStreams(): Promise<void>Reads the pending streams into chunks once, they're held so the body can be sent again A failed read stays failed, its stream is partly read