From 1d806f7791addd35ff2fd2ba8d5dc7492f02154a Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 29 Aug 2016 21:08:08 +0100 Subject: [PATCH] Parse JSON response in API client --- lib/onionoo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/onionoo.js b/lib/onionoo.js index 70870ee..1d1ad97 100644 --- a/lib/onionoo.js +++ b/lib/onionoo.js @@ -11,6 +11,10 @@ const endpoints = [ ]; module.exports = endpoints.reduce((onionoo, endpoint) => { - onionoo[endpoint] = args => rp({ uri: `${baseUrl}${endpoint}`, qs: args }); + onionoo[endpoint] = args => rp({ + uri: `${baseUrl}${endpoint}`, + qs: args, + json: true + }); return onionoo; }, {});