Skip to content

RequestOptions

Defined in: src/types/common.ts:51

Options describing a single HTTP request made by the client.

optional body?: unknown

Defined in: src/types/common.ts:67

Optional request body. A plain value is JSON-serialized with a Content-Type: application/json header. A FormData instance is passed straight through so fetch sets the multipart boundary itself; no Content-Type header is added in that case.


method: HttpMethod

Defined in: src/types/common.ts:53

HTTP method for the request.


path: string

Defined in: src/types/common.ts:60

Request target. Normally a path appended to the versioned base URL (any leading slash is stripped). When it is an absolute http(s) URL it is used verbatim instead of being prefixed with the base URL — this is how media downloads hit the short-lived Graph CDN URL directly.


optional responseType?: ResponseType

Defined in: src/types/common.ts:71

How to decode a 2xx body. Defaults to 'json'.


optional signal?: AbortSignal

Defined in: src/types/common.ts:69

Optional caller-provided abort signal, combined with the timeout signal.


optional userAgent?: string

Defined in: src/types/common.ts:73

Optional User-Agent header value (used by media downloads).

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.