Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. void LoginWindow::on_login_pushButton_clicked()
  2. {
  3. const QString url = ui->server_lineEdit->text ();
  4. const QString username = ui->username_lineEdit->text ();
  5. const QString password = ui->password_lineEdit->text ();
  6. QNetworkAccessManager mAccessManager;
  7. QNetworkRequest request(QUrl(url + "/api/auth/"));
  8.  
  9. QUrlQuery urlQuery;
  10. urlQuery.addQueryItem ("username", username);
  11. urlQuery.addQueryItem ("password", password);
  12.  
  13. QUrl params;
  14. params.setQuery (urlQuery);
  15.  
  16. QNetworkReply* reply = mAccessManager.post (request, params.toEncoded ());
  17.  
  18. connect (reply, &QNetworkReply::readyRead, [reply]() {
  19. qDebug() << "Ready to read from reply";
  20. });
  21. connect (reply, &QNetworkReply::sslErrors, [this] (QList<QSslError> error) {
  22. qWarning () << "Ssl error: " << error;
  23. });
  24.  
  25. }
  26.  
  27. qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
  28. qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement