Перейти к основному содержимому
Version: 3.5.x

API

Request input options:

NameTypeComments
endpointstringthe request url
responseSchemajoi schemathe response Schema that parsed by joi (you must use the joi in your project and insert the response Schema into this field)
body<YourType>the request body
queryParamsRecord<string,any>the object with the query parameters (they will be serialized automatically)
translateFunction(key,options) => stringfunction that will be called with error text key and params (key, params)
isErrorTextStraightToOutputbooleanflag not to prepare error text value - it goes straight from backend ("errorText" if REST and "message" if JSON-RPC)
extraValidationCallback(response:<YourType>)=>booleancallback that can be used for custom response data validation or if you don't want to use joi
customTimeoutnumbermilliseconds for cancel the request on timeout (or a full package of requests if the "retry" parameter is activated)
retrynumbernumber of requests try to request if the response is negative

Also consists of a lot of default fetch options (headers, mode, etc), see api docs

Request output options:

NameTypeComments
errorbooleanflag if the request successful
errorTextstringmain text of the error (can be translated)
data<YourType>response data
additionalErrorsanyadditional error data from backend
codenumberresponse code number,always less than 501