Qt5Http not working

  • Hello, i've been using Qt5 for a while not but i keep getting errors / it's not working and I tried all kinds of stuff.

    this SEEMS to work, but never actually completes the http request.

    class requests {
    	auto get(QUrl url)
    		QNetworkAccessManager nm;
    		QNetworkReply* nr = nm.get(QNetworkRequest(url));
    		while (!nr->isFinished()){
    			qDebug() << nr->isFinished() << nr->error();
    		qDebug() << (nr->request()).url();
    	QNetworkAccessManager *manager;
    	QNetworkRequest request;

    What is wrong with this? like i'm just requesting this:


    if anyone knows what's wrong, i appreciate it.

  • Lifetime Qt Champion

    You should not use this blocking wait but connect to QNetworkReplay::finished() or similar. See http://doc.qt.io/qt-5/qnetworkaccessmanager.html#details for more details on how to do it.

Log in to reply