batch-consuming allows you to do multiples request by batch to determined end points in three simple steps.
-
Set an url and configure your headers
const url = `your end point url` let headers = { Authorization: `${configuration.authType} ${configuration.token}`, ContentType: 'application/json' }
-
Create a new instance of
BatchConsuming
const service = new BatchConsuming(url, headers);
-
Call the method
executeAsync
and pass both the batch size and the payload arrayconst result = await connect.executeAsync(30, payload)
That's it!