Interface: FetchRequest¶
Defined in: api_types.ts:679
An HTTP request used with the Fetcher.
The structure largely follows https://developer.mozilla.org/en-US/docs/Web/API/Request
Properties¶
body?¶
optionalbody:string|Buffer
Defined in: api_types.ts:694
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.
cacheTtlSecs?¶
optionalcacheTtlSecs:number
Defined in: api_types.ts:714
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 FetchRequest.forceCache to true.
disableAuthentication?¶
optionaldisableAuthentication:boolean
Defined in: api_types.ts:736
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.
forceCache?¶
optionalforceCache:boolean
Defined in: api_types.ts:723
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.
form?¶
optionalform:object
Defined in: api_types.ts:698
Key-value form fields, if submitting to an endpoint expecting a URL-encoded form payload.
Index Signature¶
[key: string]: string
headers?¶
optionalheaders:object
Defined in: api_types.ts:702
HTTP headers. You should NOT include authentication headers, as Coda will add them for you.
Index Signature¶
[header: string]: string
ignoreRedirects?¶
optionalignoreRedirects:boolean
Defined in: api_types.ts:741
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.
isBinaryResponse?¶
optionalisBinaryResponse:boolean
Defined in: api_types.ts:730
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, FetchResponse.body will be a NodeJS Buffer.
method¶
method:
"GET"|"PATCH"|"POST"|"PUT"|"DELETE"|"HEAD"
Defined in: api_types.ts:681
The HTTP method/verb (e.g. GET or POST).
url¶
url:
string
Defined in: api_types.ts:688
The URL to connect to. This is typically an absolute URL, but if your pack uses authentication and BaseAuthentication.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.