Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capriza/http-utils

Package Overview
Dependencies
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capriza/http-utils - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

22

lib/httpUtils.js

@@ -19,20 +19,20 @@ var axios = require('axios');

async get(uri, params, body) {
return this._callRequest("get", uri, params, body);
async get(uri, params, body, priority) {
return this._callRequest("get", uri, params, body, priority);
}
async put(uri, params, body) {
return this._callRequest("put", uri, params, body);
async put(uri, params, body, priority) {
return this._callRequest("put", uri, params, body, priority);
}
async post(uri, params, body) {
return this._callRequest("post", uri, params, body);
async post(uri, params, body, priority) {
return this._callRequest("post", uri, params, body, priority);
}
async downloadUrlAttachment(uri, mediaType) {
var res = await this.get(uri, {responseType : 'arraybuffer'});
return {data: new Uint8Array(res.data), mediaType: mediaType};
async downloadUrlAttachment(uri, priority) {
var res = await this.get(uri, {responseType : 'arraybuffer'}, null, priority);
return res && res.data && (new Uint8Array(res.data));
}
async _callRequest(method, uri, params, body){
async _callRequest(method, uri, params, body, priority){
return new Promise((resolve, reject)=>{

@@ -59,3 +59,3 @@ let func = axios[method];

this.requestQueue.add(doRequest).then((response)=>resolve(response.data)).catch(onError);
this.requestQueue.add(doRequest, {priority}).then((response)=>resolve(response.data)).catch(onError);
});

@@ -62,0 +62,0 @@ }

{
"name": "@capriza/http-utils",
"version": "0.1.1",
"version": "0.1.2",
"description": "HTTP Request utils that handles, request-response, errors, concurrency, priority and authentication",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc