@capriza/http-utils
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -10,2 +10,3 @@ var axios = require('axios'); | ||
this.requestQueue = new Queue({ concurrency : options.maxConcurrent || 10000}); | ||
this.baseURL = options.baseUrl; | ||
this.http = axios.create({ | ||
@@ -47,3 +48,2 @@ baseURL: options.baseUrl, | ||
}); | ||
return this.http.request(options); | ||
@@ -54,6 +54,6 @@ }; | ||
if (err.response){ | ||
requestLog.error(`[HttpUtils] HTTP ${method} response error: ${err.response.status} ${err.response.statusText} on ${this.baseUrl}${uri}`); | ||
requestLog.error(`[HttpUtils] HTTP ${method} response error: ${err.response.status} ${err.response.statusText} on ${this.baseURL}${url}`); | ||
reject(err.response); | ||
} else { | ||
requestLog.error(`[HttpUtils] HTTP ${method} error: ${err.code} on ${this.baseUrl}${uri}`); | ||
requestLog.error(`[HttpUtils] HTTP ${method} error: ${err.code} on ${this.baseURL}${url}`); | ||
reject(err); | ||
@@ -68,3 +68,3 @@ } | ||
if(debug){ | ||
requestLog.info(`[HttpUtils] HTTP ${method} request: ${url}`); | ||
requestLog.info(`[HttpUtils] HTTP ${method} request: ${this.baseURL}${url}`); | ||
if(opts) requestLog.info(`[HttpUtils] PRIORITY[${priority}] OPTS: ${JSON.stringify(opts)}`); | ||
@@ -71,0 +71,0 @@ } |
{ | ||
"name": "@capriza/http-utils", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "HTTP Request utils that handles, request-response, errors, concurrency, priority and authentication", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20054
199