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/poll.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'protocols/Steam/src/api/poll.h') diff --git a/protocols/Steam/src/api/poll.h b/protocols/Steam/src/api/poll.h index 5c5da5674c..278dfb0439 100644 --- a/protocols/Steam/src/api/poll.h +++ b/protocols/Steam/src/api/poll.h @@ -5,23 +5,19 @@ class PollRequest : public HttpRequest { public: PollRequest(const char *token, const char *umqId, UINT32 messageId, int idleSeconds) : - HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v0001") + HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v0001") { timeout = (STEAM_API_TIMEOUT + 5) * 1000; // flags |= NLHRF_PERSISTENT; - CMStringA data; - data.AppendFormat("access_token=%s&umqid=%s&message=%u&secidletime=%d§imeout=%d", - token, - umqId, - messageId, - idleSeconds, - STEAM_API_TIMEOUT); + Headers << CHAR_PARAM("Connection", "keep-alive"); - SetData(data, data.GetLength()); - - AddHeader("Connection", "keep-alive"); - AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); + Content = new FormUrlEncodedContent(this) + << CHAR_PARAM("access_token", token) + << CHAR_PARAM("umqid", umqId) + << INT64_PARAM("message", messageId) + << INT_PARAM("secidletime", idleSeconds) + << INT_PARAM("sectimeout", STEAM_API_TIMEOUT); } }; -- cgit v1.2.3