Hi all,
I always get "Network session error" value in network_reply->errorString() and UnknownNetworkError value in network_reply->error().
I have this code:
What is wrong?Code:nam = new QNetworkAccessManager(this); connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(network_reply_finished(QNetworkReply*))); ... QUrl url("http://discussion.forum.nokia.com"); nam->get(QNetworkRequest(url)); ... void MyWindow::network_reply_finished(QNetworkReply* network_reply) { QVariant statusCodeV; // Reading attributes of the reply // e.g., the HTTP status code statusCodeV = network_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(&conversion_status); // if no error received if (network_reply->error() == QNetworkReply::NoError) { QByteArray data = network_reply->readAll(); ui.listWidget->addItem(QString(data)); } // Some http error received else //handle errors here { ui.listWidget->addItem("Error: " + network_reply->errorString()); } // We receive ownership of the reply object // and therefore need to handle deletion. delete network_reply; }
Regards.



