RequestOptions
Interface: RequestOptions<TData, ThrowOnError, Url>
Defined in: api/client/types.gen.ts:52
Extends
Config<{throwOnError:ThrowOnError; }>.Pick<ServerSentEventsOptions<TData>,"onRequest"|"onSseError"|"onSseEvent"|"sseDefaultRetryDelay"|"sseMaxRetryAttempts"|"sseMaxRetryDelay">
Type Parameters
TData
TData = unknown
ThrowOnError
ThrowOnError *extends* boolean = boolean
Url
Url *extends* string = string
Properties
auth?
optionalauth?: ((auth) => AuthToken | Promise<AuthToken>) |AuthToken
Defined in: api/core/types.gen.ts:40
Auth token or a function returning auth token. The resolved value will be
added to the request payload as defined by its security array.
Inherited from
axios?
optionalaxios?:AxiosStatic|AxiosInstance
Defined in: api/client/types.gen.ts:27
Axios implementation. You can use this option to provide either an
AxiosStatic or an AxiosInstance.
Default
axios
Inherited from
baseURL?
optionalbaseURL?:unknown
Defined in: api/client/types.gen.ts:31
Base URL for all requests made by this client.
Inherited from
body?
optionalbody?:unknown
Defined in: api/client/types.gen.ts:75
Any body that you want to add to your request.
https://developer.mozilla.org/docs/Web/API/fetch#body
bodySerializer?
optionalbodySerializer?:BodySerializer|null
Defined in: api/core/types.gen.ts:45
A function for serializing request body parameter. By default, JSON.stringify() will be used.
Inherited from
headers?
optionalheaders?:AxiosRequestHeaders|Record<string,unknown>
Defined in: api/client/types.gen.ts:38
An object containing any HTTP headers that you want to pre-populate your
Headers object with.
Inherited from
method?
optionalmethod?:"CONNECT"|"DELETE"|"GET"|"HEAD"|"OPTIONS"|"PATCH"|"POST"|"PUT"|"TRACE"
Defined in: api/core/types.gen.ts:63
The request method.
Inherited from
onRequest?
optionalonRequest?: (url,init) =>Promise<Request>
Defined in: api/core/serverSentEvents.gen.ts:17
Implementing clients can call request interceptors inside this hook.
Parameters
url
[object Object]
init
[object Object]
Returns
Promise<Request>
Inherited from
[object Object]
onSseError?
optionalonSseError?: (error) =>void
Defined in: api/core/serverSentEvents.gen.ts:25
Callback invoked when a network or parsing error occurs during streaming.
This option applies only if the endpoint returns a stream of events.
Parameters
error
[object Object]
The error that occurred.
Returns
[object Object]
Inherited from
[object Object]
onSseEvent?
optionalonSseEvent?: (event) =>void
Defined in: api/core/serverSentEvents.gen.ts:34
Callback invoked when an event is streamed from the server.
This option applies only if the endpoint returns a stream of events.
Parameters
event
StreamEvent<TData>
Event streamed from the server.
Returns
[object Object]
Nothing (void).
Inherited from
[object Object]
path?
optionalpath?:Record<string,unknown>
Defined in: api/client/types.gen.ts:76
query?
optionalquery?:Record<string,unknown>
Defined in: api/client/types.gen.ts:77
querySerializer?
optionalquerySerializer?:QuerySerializer|QuerySerializerOptions
Defined in: api/core/types.gen.ts:74
A function for serializing request query parameters. By default, arrays will be exploded in form style, objects will be exploded in deepObject style, and reserved characters are percent-encoded.
This method will have no effect if the native paramsSerializer() Axios
API function is used.
Inherited from
requestValidator?
optionalrequestValidator?: (data) =>Promise<unknown>
Defined in: api/core/types.gen.ts:80
A function validating request data. This is useful if you want to ensure the request conforms to the desired shape, so it can be safely sent to the server.
Parameters
data
[object Object]
Returns
Promise<unknown>
Inherited from
responseTransformer?
optionalresponseTransformer?: (data) =>Promise<unknown>
Defined in: api/core/types.gen.ts:85
A function transforming response data before it's returned. This is useful for post-processing data, e.g., converting ISO strings into Date objects.
Parameters
data
[object Object]
Returns
Promise<unknown>
Inherited from
responseValidator?
optionalresponseValidator?: (data) =>Promise<unknown>
Defined in: api/core/types.gen.ts:91
A function validating response data. This is useful if you want to ensure the response conforms to the desired shape, so it can be safely passed to the transformers and returned to the user.
Parameters
data
[object Object]
Returns
Promise<unknown>
Inherited from
security?
optionalsecurity?: readonlyAuth[]
Defined in: api/client/types.gen.ts:81
Security mechanism(s) to use for the request.
sseDefaultRetryDelay?
optionalsseDefaultRetryDelay?:number
Defined in: api/core/serverSentEvents.gen.ts:43
Default retry delay in milliseconds.
This option applies only if the endpoint returns a stream of events.
Default
3000
Inherited from
[object Object]
sseMaxRetryAttempts?
optionalsseMaxRetryAttempts?:number
Defined in: api/core/serverSentEvents.gen.ts:47
Maximum number of retry attempts before giving up.
Inherited from
[object Object]
sseMaxRetryDelay?
optionalsseMaxRetryDelay?:number
Defined in: api/core/serverSentEvents.gen.ts:57
Maximum retry delay in milliseconds.
Applies only when exponential backoff is used.
This option applies only if the endpoint returns a stream of events.
Default
30000
Inherited from
[object Object]
throwOnError?
optionalthrowOnError?:ThrowOnError
Defined in: api/client/types.gen.ts:49
Throw an error instead of returning it in the response?
Default
false
Inherited from
url
[object Object]
Defined in: api/client/types.gen.ts:82
Overrides
[object Object]