summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/Services/google_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src/Services/google_api.h')
-rw-r--r--plugins/CloudFile/src/Services/google_api.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/CloudFile/src/Services/google_api.h b/plugins/CloudFile/src/Services/google_api.h
index a48e9e878b..cf405dda36 100644
--- a/plugins/CloudFile/src/Services/google_api.h
+++ b/plugins/CloudFile/src/Services/google_api.h
@@ -26,6 +26,21 @@ namespace GDriveAPI
}
};
+ class RefreshTokenRequest : public HttpRequest
+ {
+ public:
+ RefreshTokenRequest(const char *refreshToken) :
+ HttpRequest(REQUEST_POST, "https://www.googleapis.com/oauth2/v4/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",
+ GOOGLE_APP_ID, GOOGLE_CLIENT_SECRET, refreshToken);
+ SetData(data.GetBuffer(), data.GetLength());
+ }
+ };
+
class RevokeAccessTokenRequest : public HttpRequest
{
public: