From e2dae00af299872e4a223b496bd592978014b842 Mon Sep 17 00:00:00 2001 From: Jarzon Date: Tue, 7 Feb 2017 15:35:29 -0500 Subject: [PATCH] Simplifying the request's options --- components/groups.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/components/groups.js b/components/groups.js index d0e5c7b..86ba37c 100644 --- a/components/groups.js +++ b/components/groups.js @@ -520,13 +520,14 @@ SteamCommunity.prototype.getGroupHistory = function(gid, page, callback) { }; SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callback) { - var options = {}; - options.uri = "http://steamcommunity.com/comment/Clan/render/" + gid.getSteamID64() + "/-1/"; - options.headers = { - "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" + var options = { + uri: "http://steamcommunity.com/comment/Clan/render/" + gid.getSteamID64() + "/-1/", + method: "POST", + form: { + start: from, + count: count + } }; - options.method = "POST"; - options.body = "start=" + from + "&count=" + count; var self = this; this.httpRequest(options, function(err, response, body) { @@ -557,4 +558,4 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba callback(null, comments); }, "steamcommunity"); -}; +}; \ No newline at end of file