summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api/poll.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-12-28 21:21:10 +0300
committeraunsane <aunsane@gmail.com>2017-12-28 21:21:28 +0300
commit0156ed41dceeef48f070adf67f14d4ba4c4f6d61 (patch)
treed0e1dca4c2c9c3c056ae9cb69dde10ea59316481 /protocols/Steam/src/api/poll.h
parentf0075f2b956969f29acd3bc9289c8a5f78faddad (diff)
Steam: refactoring
- reworking http requests - added ability to get game name by appid - another attempt to fix #633 - minor refactoring
Diffstat (limited to 'protocols/Steam/src/api/poll.h')
-rw-r--r--protocols/Steam/src/api/poll.h20
1 files changed, 8 insertions, 12 deletions
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&sectimeout=%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);
}
};