From 0156ed41dceeef48f070adf67f14d4ba4c4f6d61 Mon Sep 17 00:00:00 2001 From: aunsane Date: Thu, 28 Dec 2017 21:21:10 +0300 Subject: Steam: refactoring - reworking http requests - added ability to get game name by appid - another attempt to fix #633 - minor refactoring --- protocols/Steam/src/api/search.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'protocols/Steam/src/api/search.h') diff --git a/protocols/Steam/src/api/search.h b/protocols/Steam/src/api/search.h index a22ed64431..a34c2e8398 100644 --- a/protocols/Steam/src/api/search.h +++ b/protocols/Steam/src/api/search.h @@ -5,13 +5,15 @@ class SearchRequest : public HttpRequest { public: SearchRequest(const char *token, const char *text, int offset = 0, int count = 30) : - HttpRequest(REQUEST_GET, STEAM_API_URL "/ISteamUserOAuth/Search/v0001") + HttpRequest(HttpGet, STEAM_API_URL "/ISteamUserOAuth/Search/v0001") { - AddParameter("access_token", token); - AddParameter("keywords", ptrA(mir_urlEncode(text))); - AddParameter("offset=%d", offset); - AddParameter("count=%d", count); - AddParameter("targets=users&fields=all"); + Uri + << CHAR_PARAM("access_token", token) + << CHAR_PARAM("keywords", text) + << INT_PARAM("offset=%d", offset) + << INT_PARAM("count=%d", count) + << CHAR_PARAM("targets", "users") + << CHAR_PARAM("fields", "all"); } }; -- cgit v1.2.3