Have you tried something like this:
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
QUrl url
("https://accounts.google.com/o/oauth2/token");
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
params.addQueryItem("client_id", "...");
params.addQueryItem("client_secret", "...");
params.addQueryItem("code", "...");
// etc
QObject::connect(manager,
SIGNAL(finished
(QNetworkReply
*)),
this,
SLOT(replyFinished
(QNetworkReply
*)));
manager->post(request, params.encodedQuery());
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
QUrl url("https://accounts.google.com/o/oauth2/token");
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QUrl params;
params.addQueryItem("client_id", "...");
params.addQueryItem("client_secret", "...");
params.addQueryItem("code", "...");
// etc
QObject::connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(replyFinished(QNetworkReply *)));
manager->post(request, params.encodedQuery());
To copy to clipboard, switch view to plain text mode
Bookmarks