v1.3.11: pass callback
This commit is contained in:
parent
28f3f783ae
commit
335dd98631
4
index.js
4
index.js
|
@ -391,12 +391,12 @@ function setDefaults(defs) {
|
||||||
return setDefaults(_defs);
|
return setDefaults(_defs);
|
||||||
};
|
};
|
||||||
[ 'get', 'put', 'post', 'patch', 'delete', 'head', 'options' ].forEach(function (method) {
|
[ 'get', 'put', 'post', 'patch', 'delete', 'head', 'options' ].forEach(function (method) {
|
||||||
urequest[method] = function (obj) {
|
urequest[method] = function (obj, cb) {
|
||||||
if ('string' === typeof obj) {
|
if ('string' === typeof obj) {
|
||||||
obj = { url: obj };
|
obj = { url: obj };
|
||||||
}
|
}
|
||||||
obj.method = method.toUpperCase();
|
obj.method = method.toUpperCase();
|
||||||
urequest(obj);
|
urequest(obj, cb);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
urequest.del = urequest.delete;
|
urequest.del = urequest.delete;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@root/request",
|
"name": "@root/request",
|
||||||
"version": "1.3.10",
|
"version": "1.3.11",
|
||||||
"description": "A lightweight, zero-dependency drop-in replacement for request",
|
"description": "A lightweight, zero-dependency drop-in replacement for request",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
Loading…
Reference in New Issue