Skip to content

RequestOptions

Defined in: clients/http-client/src/rest-client.ts:64

Options for one RestClient.request call.

optional body?: unknown

Defined in: clients/http-client/src/rest-client.ts:68

The request body; sent as JSON with a content-type header. Left out or undefined, no body is sent.


optional expectNoContent?: boolean

Defined in: clients/http-client/src/rest-client.ts:72

Return undefined without parsing even on a 200 response.


optional method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE"

Defined in: clients/http-client/src/rest-client.ts:66

The HTTP method. Defaults to "GET".


optional onResponse?: (headers) => void

Defined in: clients/http-client/src/rest-client.ts:78

Called with the response headers of a successful (2xx) response, before the body is read. For a value the vendor returns in a header rather than the body (GitHub’s token expiry). A failed response throws as before and does not call it.

Headers

void


optional query?: Record<string, string>

Defined in: clients/http-client/src/rest-client.ts:70

Per-request query params, merged after defaultQuery.