Skip to content

Interface: FetchRequest

core.FetchRequest

An HTTP request used with the Fetcher.

The structure largely follows https://developer.mozilla.org/en-US/docs/Web/API/Request

Properties

body

Optional body: string | Buffer

The body of the HTTP request, if any.

If you are sending a JSON payload, make sure to call JSON.stringify() on the object payload.

Defined in

api_types.ts:563


cacheTtlSecs

Optional cacheTtlSecs: number

A time in seconds that Coda should cache the result of this HTTP request.

Any time that this pack makes the same FetchRequest, a cached value can be returned instead of making the HTTP request. If left unspecified, Coda will automatically cache all GET requests for approximately 5 minutes. To disable the default caching, set this value to 0.

If you are trying to cache a POST, PUT, PATCH, or DELETE request, you must also set forceCache to true.

Defined in

api_types.ts:583


disableAuthentication

Optional disableAuthentication: boolean

If true, Coda will not apply authentication credentials even if this pack is configured to use authentication. This is very rare, but sometimes you may wish to make an unauthenticated supporting request as part of a formula implementation.

Defined in

api_types.ts:605


forceCache

Optional forceCache: boolean

If true, Coda will cache the request (including POST, PUT, PATCH, and DELETE) and return the same response for subsequent requests. This option does not need to be specified to cache GET requests.

This is mainly used for POST requests that do not have side effects, such as querying a GraphQL API.

Defined in

api_types.ts:592


form

Optional form: Object

Key-value form fields, if submitting to an endpoint expecting a URL-encoded form payload.

Index signature

▪ [key: string]: string

Defined in

api_types.ts:567


headers

Optional headers: Object

HTTP headers. You should NOT include authentication headers, as Coda will add them for you.

Index signature

▪ [header: string]: string

Defined in

api_types.ts:571


ignoreRedirects

Optional ignoreRedirects: boolean

If true, will immediately return a response when encountering an HTTP 301 You may inspect the Location header of the response to observe the indicated redirect URL.

Defined in

api_types.ts:610


isBinaryResponse

Optional isBinaryResponse: boolean

Indicates that you expect the response to be binary data, instructing Coda not to attempt to parse the response in any way. Otherwise, Coda may attempt to parse the response as a JSON object. If true, body will be a NodeJS Buffer.

Defined in

api_types.ts:599


method

method: "GET" | "PATCH" | "POST" | "PUT" | "DELETE" | "HEAD"

The HTTP method/verb (e.g. GET or POST).

Defined in

api_types.ts:550


url

url: string

The URL to connect to. This is typically an absolute URL, but if your pack uses authentication and requiresEndpointUrl and so has a unique endpoint per user account, you may also use a relative URL and Coda will apply the user's endpoint automatically.

Defined in

api_types.ts:557