Hi, I did a demo using QNetworkAccessManager to post a request to google account authentication url
https://www.google.com/accounts/ClientLogin
with my email and password .etc as request body, but I always got the reply status code 0,normally the satus
code is 200
The parameter used in authentication is located at
http://code.google.com/apis/accounts...alledApps.html
The practice is more or less like this,
QNetworkRequest* request = new QNetworkRequest(QUrl("https://www.google.com/accounts/ClientLogin"));
QByteArray content = "EMAIL=***&Passwd=***&service=cl&source=***&accoun tType=***";
request->setHeader(QNetworkRequest::ContentTypeHeader,"app lication/x-www-form-urlencoded");
networkAccessManager->post(*request, content);
and In onFinished(QNetworkReply* reply) slot, I get reply status code by
reply->attribute(QNetworkRequest::HttpStatusCodeAttribut e).toInt();
The status code of reply is always 0. I don't know why, normally the status code should be 200. and if I modify the https to http, the reply status code turn to 302 means redirection, this seems correct.
Bookmarks