diff options
author | aunsane <aunsane@gmail.com> | 2017-12-28 21:21:10 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-12-28 21:21:28 +0300 |
commit | 0156ed41dceeef48f070adf67f14d4ba4c4f6d61 (patch) | |
tree | d0e1dca4c2c9c3c056ae9cb69dde10ea59316481 /protocols/Steam/src/api/session.h | |
parent | f0075f2b956969f29acd3bc9289c8a5f78faddad (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/session.h')
-rw-r--r-- | protocols/Steam/src/api/session.h | 12 |
1 files changed, 7 insertions, 5 deletions
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;
}
|