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/session.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'protocols/Steam/src/api/session.h') diff --git a/protocols/Steam/src/api/session.h b/protocols/Steam/src/api/session.h index b00e470da6..d4e91721cb 100644 --- a/protocols/Steam/src/api/session.h +++ b/protocols/Steam/src/api/session.h @@ -5,19 +5,21 @@ class GetSessionRequest : public HttpRequest { public: GetSessionRequest(const char *token, const char *steamId, const char *cookie) : - HttpRequest(REQUEST_POST, STEAM_WEB_URL "/mobileloginsucceeded") + HttpRequest(HttpPost, STEAM_WEB_URL "/mobileloginsucceeded") { flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMP; + Content = new FormUrlEncodedContent(this) + << CHAR_PARAM("oauth_token", token) + << CHAR_PARAM("steamid", steamId) + << CHAR_PARAM("webcookie", cookie); + char data[512]; mir_snprintf(data, _countof(data), "oauth_token=%s&steamid=%s&webcookie=%s", token, steamId, cookie); - - SetData(data, strlen(data)); - AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); } }; @@ -25,7 +27,7 @@ class GetSessionRequest2 : public HttpRequest { public: GetSessionRequest2() : - HttpRequest(REQUEST_GET, STEAM_WEB_URL) + HttpRequest(HttpGet, STEAM_WEB_URL) { flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMP; } -- cgit v1.2.3