faithlife-api
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -65,5 +65,9 @@ /*! | ||
BaseApiClient.prototype.request = function request(method, path, body) { | ||
path = this.getUrl(path); | ||
console.log('%s %s', method, path); | ||
return makeRequest({ | ||
method: method, | ||
url: this.getUrl(path), | ||
url: path, | ||
headers: { | ||
@@ -73,3 +77,7 @@ Authorization: this._authorization | ||
content: body | ||
}); | ||
}) | ||
.then(null, function (err) { | ||
console.error('Error in %s %s: %s', method, path, err); | ||
throw err; | ||
}); | ||
}; | ||
@@ -119,2 +127,4 @@ | ||
app.use(mach.params); | ||
app.use(function (app) { | ||
@@ -133,3 +143,6 @@ return function (request) { | ||
if (content && typeof content !== 'string') { | ||
response.headers['Content-Length'] = response.headers['content-length']; | ||
delete response.headers['content-length']; | ||
if (typeof content !== 'string') { | ||
content = JSON.stringify(content); | ||
@@ -136,0 +149,0 @@ } |
{ | ||
"name": "faithlife-api", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A collection of CommonJS modules for interacting with the Faithlife API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
10422
305