Skip to content

encodeBinaryBody

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/multipart.ts

A raw-bytes body for the same envelope. application/octet-stream sends the file ITSELF, not a form, so it cannot be smuggled through as a part — it needs its own field, and it hits the same JSON.stringify(File) === '{}' trap if it is left as-is.

Signature

ts
async function encodeBinaryBody(blob: Blob): Promise<{ base64: string; bytes: number }>

Parameters

NameType
blobBlob

Returns: Promise<{ base64: string; bytes: number }>

Was this page helpful?

Download as PDF