Comparing version 2.0.0-next.0 to 2.0.0-next.1
@@ -9,3 +9,3 @@ function apply(src, tar) { | ||
export function send(method, uri, opts) { | ||
return new Promise((res, rej) => { | ||
return new Promise(function (res, rej) { | ||
opts = opts || {}; | ||
@@ -12,0 +12,0 @@ var k, str, tmp, arr; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.httpie={})}(this,function(t){function e(t,e){e.headers=t.headers||{},e.statusMessage=t.statusText,e.statusCode=t.status,e.data=t.response}function n(t,n,o){return new Promise((s,i)=>{var r,a,d,u;o=o||{};var p=new XMLHttpRequest,f=o.headers||{};for(r in p.timeout=o.timeout,p.ontimeout=p.onerror=function(t){t.timeout="timeout"==t.type,i(t)},p.open(t,n),p.onload=function(){for(u=p.getAllResponseHeaders().trim().split(/[\r\n]+/),e(p,p);d=u.shift();)d=d.split(": "),p.headers[d.shift().toLowerCase()]=d.join(": ");if((d=p.headers["content-type"])&&~d.indexOf("application/json"))try{p.data=JSON.parse(p.data,o.reviver)}catch(t){return e(p,t),i(t)}(p.status>=400?i:s)(p)},(a=o.body)&&(/Array|Object/.test(a.constructor.name)&&(f["content-type"]="application/json",a=JSON.stringify(a)),f["content-length"]=a.length),f)p.setRequestHeader(r,f[r]);p.send(a)})}var o=n.bind(n,"GET"),s=n.bind(n,"POST"),i=n.bind(n,"PATCH"),r=n.bind(n,"DELETE"),a=n.bind(n,"PUT");t.del=r,t.get=o,t.patch=i,t.post=s,t.put=a,t.send=n}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.httpie={})}(this,function(t){function e(t,e){e.headers=t.headers||{},e.statusMessage=t.statusText,e.statusCode=t.status,e.data=t.response}function n(t,n,o){return new Promise(function(s,i){var r,a,d,u;o=o||{};var p=new XMLHttpRequest,f=o.headers||{};for(r in p.timeout=o.timeout,p.ontimeout=p.onerror=function(t){t.timeout="timeout"==t.type,i(t)},p.open(t,n),p.onload=function(){for(u=p.getAllResponseHeaders().trim().split(/[\r\n]+/),e(p,p);d=u.shift();)d=d.split(": "),p.headers[d.shift().toLowerCase()]=d.join(": ");if((d=p.headers["content-type"])&&~d.indexOf("application/json"))try{p.data=JSON.parse(p.data,o.reviver)}catch(t){return e(p,t),i(t)}(p.status>=400?i:s)(p)},(a=o.body)&&(/Array|Object/.test(a.constructor.name)&&(f["content-type"]="application/json",a=JSON.stringify(a)),f["content-length"]=a.length),f)p.setRequestHeader(r,f[r]);p.send(a)})}var o=n.bind(n,"GET"),s=n.bind(n,"POST"),i=n.bind(n,"PATCH"),r=n.bind(n,"DELETE"),a=n.bind(n,"PUT");t.del=r,t.get=o,t.patch=i,t.post=s,t.put=a,t.send=n}); |
{ | ||
"name": "httpie", | ||
"version": "2.0.0-next.0", | ||
"version": "2.0.0-next.1", | ||
"repository": "lukeed/httpie", | ||
@@ -5,0 +5,0 @@ "description": "A lightweight, Promise-based wrapper for Node.js HTTP requests~!", |
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
16046