# Interface: FetchRequest

Defined in: [api_types.ts:741](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L741)

An HTTP request used with the [Fetcher](../Fetcher/).

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

## Properties

### body?

> `optional` **body**: `string` | `Buffer`

Defined in: [api_types.ts:756](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L756)

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?

> `optional` **cacheTtlSecs**: `number`

Defined in: [api_types.ts:776](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L776)

A time in seconds that the platform 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, the platform 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](#forcecache) to true.

______________________________________________________________________

### disableAuthentication?

> `optional` **disableAuthentication**: `boolean`

Defined in: [api_types.ts:798](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L798)

If true, the platform 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?

> `optional` **forceCache**: `boolean`

Defined in: [api_types.ts:785](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L785)

If true, the platform 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?

> `optional` **form**: `object`

Defined in: [api_types.ts:760](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L760)

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

#### Index Signature

______________________________________________________________________

### headers?

> `optional` **headers**: `object`

Defined in: [api_types.ts:764](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L764)

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

#### Index Signature

______________________________________________________________________

### ignoreRedirects?

> `optional` **ignoreRedirects**: `boolean`

Defined in: [api_types.ts:803](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L803)

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?

> `optional` **isBinaryResponse**: `boolean`

Defined in: [api_types.ts:792](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L792)

Indicates that you expect the response to be binary data, instructing the platform not to attempt to parse the response in any way. Otherwise, the platform may attempt to parse the response as a JSON object. If true, [FetchResponse.body](../FetchResponse/#body) will be a NodeJS Buffer.

______________________________________________________________________

### method

> **method**: `"GET"` | `"PATCH"` | `"POST"` | `"PUT"` | `"DELETE"` | `"HEAD"`

Defined in: [api_types.ts:743](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L743)

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

______________________________________________________________________

### url

> **url**: `string`

Defined in: [api_types.ts:750](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/api_types.ts#L750)

The URL to connect to. This is typically an absolute URL, but if your pack uses authentication and [BaseAuthentication.requiresEndpointUrl](../BaseAuthentication/#requiresendpointurl) and so has a unique endpoint per user account, you may also use a relative URL and the platform will apply the user's endpoint automatically.
