Skip to main content

HTTP Transport abstraction for cross-platform support.

interface HttpRequestOptions
body?: string;
bytes?: Uint8Array<ArrayBufferLike>;
headers: Record<string, string>;
maxResponseBytes?: number;
method: “GET” | “POST”;
responseType?: “text” | “binary”;
timeout?: number;
url: string;
body?: string

Request body, as text

bytes?: Uint8Array<ArrayBufferLike>

Request body, as bytes: set in place of body by a client constructed with encoding: ‘binary’. A custom transport serving such a client must send these unchanged.

headers: Record<string, string>
maxResponseBytes?: number

Abandon the response once it passes this many bytes, rejecting with a ResponseTooLargeError. 0 or omitted means no ceiling.

method: “GET” | “POST”
responseType?: “text” | “binary“

‘binary’ also fills in bytes on the response, for responses that are not text — WMS images, and the Avro a binary-encoding client receives. Decoding those as text would corrupt them.

timeout?: number
url: string