diff options
Diffstat (limited to 'plugins/CloudFile/src/Services/yandex_api.h')
-rw-r--r-- | plugins/CloudFile/src/Services/yandex_api.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/Services/yandex_api.h b/plugins/CloudFile/src/Services/yandex_api.h index f70964bc78..2a83abb634 100644 --- a/plugins/CloudFile/src/Services/yandex_api.h +++ b/plugins/CloudFile/src/Services/yandex_api.h @@ -24,6 +24,21 @@ namespace YandexAPI } }; + class RefreshTokenRequest : public HttpRequest + { + public: + RefreshTokenRequest(const char *refreshToken) : + HttpRequest(REQUEST_POST, YANDEX_OAUTH "/token") + { + AddHeader("Content-Type", "application/x-www-form-urlencoded"); + + CMStringA data(CMStringDataFormat::FORMAT, + "client_id=%s&client_secret=%s&grant_type=refresh_token&refresh_token=%s", + YANDEX_APP_ID, YADISK_CLIENT_SECRET, refreshToken); + SetData(data.GetBuffer(), data.GetLength()); + } + }; + class RevokeAccessTokenRequest : public HttpRequest { public: |