The SDK uses axios library internally to perform HTTP calls. This can be customized and one can use any other (async) protocol, which is implemented in the transport.js file.
The transport protocol defines
The transport protocol exports a single asynchronous function request which takes two parameters.
The first parameter is the request object with the following attributes. Note that it matches axios requests.
The second parameter is an set of additional parameters that have been pushed down to the transport layer (see the Pushdown paragraph for more details). In particular, the timeout and AbortSignal parameters should be honored by the transport layer.
If the request is successful, a promise is returned with the result payload, as a string.
If the request fails, the promise is rejected with an error object either having class HttpError or AbortError
HttpError class has the following attributes:
For proper error handling by the ACC SDK, it's important that the actual class of returned objects is named either HttpError or AbortError
The transport can be overriden by using the client.setTransport call and passing it a transport function, i.e. an async function which