GRAB Options Reference
GRAB Options Reference
GRAB Options Reference
Type declaration
| Name | Type | Description |
|---|---|---|
|
| include headers and authorization in the request |
|
| Pre-initialized object which becomes response JSON, no need for .data |
|
| default="GET" The HTTP method to use |
|
| default=false Whether to cache the request and from frontend cache |
|
| default=60 Seconds to consider data stale and invalidate cache |
|
| default=30 The timeout for the request in seconds |
|
| default='/api/' base url prefix, override with SERVER_API_URL env |
|
| default=true Cancel previous requests to same path |
|
| default=false Cancel if a request to path is in progress |
|
| default=false If set, how many seconds to wait between requests |
|
| default=false Whether to log the request and response |
| [ | default=null [page key, response field to concatenate, element with results] |
|
| default=false Pass this with options to set those options as defaults for all requests |
|
| default=0 Retry failed requests this many times |
| (... | default=log Custom logger to override the built-in color JSON log() |
| (... | Set with defaults to modify each request data. Takes and returns in order: path, response, params, fetchParams |
| (... | Set with defaults to modify each request data. Takes and returns in order: path, response, params, fetchParams |
| (... | Set with defaults to modify each request data. Takes and returns in order: error, path, params |
| (... | Set with defaults to process the response as a stream (i.e., for instant unzip) |
|
| default=0 Repeat request this many times |
|
| default=null Repeat request every seconds |
|
| default=0 Seconds to debounce request, wait to execute so that other requests may override |
|
| default=false Refetch when cache is past cacheForTime |
|
| default=false Refetch on window refocus |
|
| default=false Refetch on network change |
|
| shortcut for method: "POST" |
|
| shortcut for method: "PUT" |
|
| shortcut for method: "PATCH" |
|
| default=null The body of the POST/PUT/PATCH request (can be passed into main) |