diff --git a/lib/method.js b/lib/method.js index 586adac..6fc0278 100644 --- a/lib/method.js +++ b/lib/method.js @@ -119,8 +119,9 @@ module.exports = function(data, key) { function done(err, res) { var result; - if (!data.isBinary) { - result = data.isJSON ? res.body : res.text; + var isJSON = res.headers['content-type'] === 'application/json'; + if (!data.isBinary || isJSON) { + result = data.isJSON || isJSON ? res.body : res.text; callback(null, result); resolve(result); } else {