UNPKG

oklink-api

Version:

This is a non-official JS SDK API for calling OKLink's API product.

30 lines 784 B
/* eslint-disable @typescript-eslint/no-explicit-any */ import axios from 'axios'; import http from 'http'; import https from 'https'; const httpAgent = new http.Agent({ keepAlive: true, keepAliveMsecs: 5000, }); const httpsAgent = new https.Agent({ keepAlive: true, keepAliveMsecs: 5000, }); const axiosInstance = axios.create({ headers: { 'content-type': 'application/json;charset=utf-8', Accept: 'application/json', }, maxRedirects: 0, timeout: 5000, httpAgent, httpsAgent, validateStatus: (status) => { return status < 600; }, }); const httpClient = (options) => { return axiosInstance.request(options); }; export { httpClient }; //# sourceMappingURL=defaultHttpClient.js.map