I'm using this code to make a simple HTTP Post ( a login )
QNetworkAccessManager *nwam = new QNetworkAccessManager;
QNetworkRequest request
(QUrl("http://localhost/laptop/trylogin.php"));
params.addQueryItem("user", userString );
params.addQueryItem("pass", passString );
data.append(params.toString());
data.remove(0,1);
QNetworkReply *reply = nwam->post(request,data);
QNetworkAccessManager *nwam = new QNetworkAccessManager;
QNetworkRequest request(QUrl("http://localhost/laptop/trylogin.php"));
QByteArray data;
QUrl params;
QString userString(user);
QString passString(pass);
params.addQueryItem("user", userString );
params.addQueryItem("pass", passString );
data.append(params.toString());
data.remove(0,1);
QNetworkReply *reply = nwam->post(request,data);
To copy to clipboard, switch view to plain text mode
If the logging succeedes or not, how do i send and read the response in Qt ?
Or, which is the best way to do this ?
Bookmarks