Skip to content

Type Alias: UploadChunk ​

UploadChunk = string | ArrayBuffer | ArrayBufferView

Defined in: api/rust-fetch.d.ts:34

A request body:

  • string is sent as-is (text/plain unless you set Content-Type)
  • Uint8Array / ArrayBuffer / any ArrayBufferView is sent as bytes (application/octet-stream)
  • Blob / File is sent as bytes with the blob's type
  • FormData is sent as multipart/form-data, including files
  • URLSearchParams is sent form-encoded (application/x-www-form-urlencoded)
  • ReadableStream / async iterable byte sources stream with backpressure; a factory permits replay
  • anything else is sent as JSON (application/json), like JSON.stringify

Released under the MIT or Apache-2.0 license.