Optional
checkIf true, throws an error if the response is not ok
, i.e. if
the response status code is not between 200 and 299.
Default: false.
Optional
contextArbitrary settings that can be read by interceptors.
Optional
preventEnsures that the target resource is fresh from the server.
This is a shorthand for the fetch option cache: "no-store"
.
Optional
proxyBy default, requests will use a proxy only if a proxy rule matches.
If "force-on"
is configured, the request will always use a proxy server,
falling back to the default proxy if no proxy rule matches.
An error will be thrown if no default proxy is configured in this case.
If "force-off"
is used, no proxy server will be used, even if a proxy rule would match.
Optional
queryConvenience option to add additional query arguments to the request.
The transport of the given value depends on the value of queryTransport
.
By default, query arguments passed here will be appended to the query part of the request URL.
Optional
queryConfigures the way the query
value is transported to the server.
"url"
(the default) to append the query to the request url."form"
instead to set the request body to query
(encoded as application/x-www-form-urlencoded
).
No other request body should be specified in this case.If query
is a string, then it should already be URL encoded.
If query
is an instance of URLSearchParams, all params will simply be copied.
If query
is a plain object, all properties will be serialized by calling objectToQuery()
from
apprt-core/url-utils
.
Default: "url"
.
Optional
supportsIf set to true
, GET requests with very long URLs (see Config.maxUrlLength)
will automatically switch to POST requests.
Default: false
Optional
timeoutTime in milliseconds after which the fetch aborts with a timeout.
Defaults to the timeout settings on the global configuration object: config
.
Request options supported by apprt-request. This is an extension of the Browser's native fetch options.
See also the init parameter of apprt-fetch for a list of all options provided by the browser.