Interface: RequestHandlerOptions
Options for a RequestHandler
Hierarchy
↳
RequestHandlerOptions
Properties
rejectIfNotValid
• Optional rejectIfNotValid: boolean
Set this false to use res.ok property.
Defined in
connections
• Optional connections: number
The max number of clients to create. null if no limit. Default null.
Defined in
pipelining
• Optional pipelining: number
The amount of concurrent requests to be sent over the single TCP/TLS connection according to RFC7230. Default: 1
Defined in
onError
• Optional onError: (args: { path: string ; status: number ; body: unknown }) => unknown
Type declaration
▸ (args): unknown
Parameters
| Name | Type |
|---|---|
args | Object |
args.path | string |
args.status | number |
args.body | unknown |
Returns
unknown
Defined in
keys
• Optional keys: string[]
Keys from Clash of Clans API developer site.
Inherited from
Defined in
baseURL
• Optional baseURL: string
Base URL of the Clash of Clans API.
Inherited from
Defined in
retryLimit
• Optional retryLimit: number
How many times to retry on 5XX errors.
Inherited from
Defined in
cache
• Optional cache: boolean | Store<any>
Whether enable or disable internal caching.
Example
const client = new Client({ cache: true });
Inherited from
Defined in
restRequestTimeout
• Optional restRequestTimeout: number
Time to wait before cancelling a REST request, in milliseconds.
Inherited from
ClientOptions.restRequestTimeout
Defined in
throttler
• Optional throttler: null | QueueThrottler | BatchThrottler
Throttler class which handles rate-limit
Example
const client = new Client({ throttler: new QueueThrottler(1000 / 10) });
Example
const client = new Client({ throttler: new BatchThrottler(30) });