I am trying to make POST request to remote server. Here is my code:
void LoginWindow::on_login_pushButton_clicked()
{
const QString url = ui->server_lineEdit->text ();
const QString username = ui->username_lineEdit->text ();
const QString password = ui->password_lineEdit->text ();
QNetworkAccessManager mAccessManager;
QNetworkRequest request(QUrl(url + "/api/auth/"));
QUrlQuery urlQuery;
urlQuery.addQueryItem ("username", username);
urlQuery.addQueryItem ("password", password);
QUrl params;
params.setQuery (urlQuery);
QNetworkReply* reply = mAccessManager.post (request, params.toEncoded ());
connect (reply, &QNetworkReply::readyRead, [reply]() {
qDebug() << "Ready to read from reply";
});
connect (reply, &QNetworkReply::sslErrors, [this] (QList<QSslError> error) {
qWarning () << "Ssl error: " << error;
});
}
When I clicked the login button nothing happens, except a message in application output tab.
qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
I checked the remote server log, there was no request from qt client.
I am using ubuntu 16.04 and Qt 5.9 . I also followed this solution, still no luck
sudo apt-get install libssl-dev
– saeed