@capriza/http-utils
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -22,20 +22,20 @@ var axios = require('axios'); | ||
async get(url, opts, { priority, debug, logger}) { | ||
return this._callRequest("get", url, opts, { priority, debug, logger }); | ||
async get(url, opts, context) { | ||
return this._callRequest("get", url, opts, context); | ||
} | ||
async put(url, opts, { priority, debug, logger }) { | ||
return this._callRequest("put", url, opts, { priority, debug, logger }); | ||
async put(url, opts, context) { | ||
return this._callRequest("put", url, opts, context); | ||
} | ||
async post(url, opts, { priority, debug, logger }) { | ||
return this._callRequest("post", url, opts, { priority, debug, logger }); | ||
async post(url, opts, context) { | ||
return this._callRequest("post", url, opts, context); | ||
} | ||
async downloadUrlAttachment(uri, { priority, debug, logger }) { | ||
var res = await this.get(uri, {responseType : 'arraybuffer'}, { priority, debug, logger }); | ||
async downloadUrlAttachment(uri, context) { | ||
var res = await this.get(uri, {responseType : 'arraybuffer'}, context); | ||
return res && (new Uint8Array(res)); | ||
} | ||
async _callRequest(method, url, opts = {}, { priority, debug, logger}){ | ||
async _callRequest(method, url, opts = {}, { priority, debug, logger } = {}){ | ||
const requestLog = logger || this.logger; | ||
@@ -42,0 +42,0 @@ return new Promise((resolve, reject)=>{ |
{ | ||
"name": "@capriza/http-utils", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "HTTP Request utils that handles, request-response, errors, concurrency, priority and authentication", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
19920