eh-api-client
Advanced tools
Comparing version 0.8.4 to 0.8.5
var | ||
request = require("request"), | ||
Q = require("q"); | ||
Q = require("q"), | ||
_ = require("lodash"); | ||
@@ -111,2 +112,5 @@ function buildError(res, data, url) { | ||
} | ||
if(options.headers) { | ||
_.assign(reqParams.headers, options.headers); | ||
} | ||
// _res will store result of http request, for return in callback | ||
@@ -113,0 +117,0 @@ var _res; |
{ | ||
"name": "eh-api-client", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"description": "Node.js rest client", | ||
@@ -16,2 +16,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"lodash": "^3.9.3", | ||
"q": "^1.4.1", | ||
@@ -18,0 +19,0 @@ "request": "^2.55.0" |
@@ -20,2 +20,16 @@ var | ||
}); | ||
it("post with headers", function(done) { | ||
var headers = { | ||
"x-custom-header-1": "1", | ||
"x-custom-header-2": "2" | ||
}; | ||
f.post({ | ||
test: true, | ||
url: "temp", | ||
headers: headers | ||
}).then(function(res) { | ||
res.headers.should.eql(headers); | ||
}).done(done); | ||
}); | ||
}); | ||
@@ -26,2 +40,17 @@ | ||
it("post with headers", function(done) { | ||
var headers = { | ||
"x-custom-header-1": "1", | ||
"x-custom-header-2": "2" | ||
}; | ||
client.post({ | ||
test: true, | ||
url: "temp", | ||
headers: headers | ||
}, function(err, res) { | ||
res.headers.should.containDeep(headers); | ||
done(); | ||
}); | ||
}); | ||
it("get notes", function(done) { | ||
@@ -28,0 +57,0 @@ client.get("/notes/", function(err, data) { |
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
9324
336
3
194
+ Addedlodash@^3.9.3
+ Addedlodash@3.10.1(transitive)