Interface FetchRequestOptions

Request options for fetchJson and fetchArrayBuffer

Hierarchy

  • RequestOptions
    • FetchRequestOptions

Properties

body?: string | object

Request body.

When an object is provided for body, it will be serialized into JSON string by default. When application/x-www-form-urlencoded header is provided, the object will be serialized as query params.

headers?: Record<string, unknown>

Request headers. An object with key-value pair.

For a undefined value, the corresponding header will not be added to the request. For a non-string value, it will be serialized before being added as a header.

method?: "GET" | "POST"

HTTP method, GET or POST. Default value is GET.

query?: Record<string, unknown>

Query params. An object with key-value pair.

The object will be serialized as query string and appended to the url.

Generated using TypeDoc