use json parsing in request

This commit is contained in:
Brian Gough
2020-06-12 15:15:51 +01:00
parent 33d6462875
commit 6569da0242

View File

@@ -81,13 +81,14 @@ module.exports = Client = {
file, file,
line, line,
column column
} },
json: true
}, },
(error, response, body) => { (error, response, body) => {
if (error != null) { if (error != null) {
return callback(error) return callback(error)
} }
return callback(null, JSON.parse(body)) return callback(null, body)
} }
) )
}, },
@@ -103,13 +104,14 @@ module.exports = Client = {
page, page,
h, h,
v v
} },
json: true
}, },
(error, response, body) => { (error, response, body) => {
if (error != null) { if (error != null) {
return callback(error) return callback(error)
} }
return callback(null, JSON.parse(body)) return callback(null, body)
} }
) )
}, },