Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] QNetworkAccessManager failing to retrieve data
reply = qnam.get(request); connect(reply, SIGNAL(finished()), this, SLOT(httpFinished())); connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead())); connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateDataReadProgress(qint64,qint64))); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(httpError(QNetworkReply::NetworkError)));
kDebug() << "httpFinished - " << reply->errorString() << endl;
QByteArray data = reply->readAll();
kDebug() << s << endl;
void KWhirlMonView::httpError ( QNetworkReply::NetworkError code )
kDebug() << code << endl;
the error slot always triggers with error code 203
The error String is "Error downloading http://whirlpool.net.au - server replied: Not found"
The data returned is : "<html><body>The requested resource could not be found.</body></html>"
I can open the site fine with any browser and other windows SDK code (delphi + indy httpClient)
Thanks - Lindsay
koahnig last edited by
Your first referenced link on this page here is broken (first line). It includes ")," .
ps - Thanks though! :)
koahnig last edited by
Sorry, it is just a problem in your positing.
In the first line of your post you have attached immediately after the link a ')' and a ','.
If one tries to follow this link, one will get an error message. This is a problem of devnet.
Unfortunately, it does not address your actual problem.
[Edit] Someone has fixed it in the mean time.
That was me :) thanks for the heads up
lgeyer last edited by
Have you tried to use Wireshark or tcpdump to spot the difference between the two requests?
What does qDebug() << reply->request()->url() say?
Probably the site has some restrictions based on user agent or access pattern to block your request. At least they have some sense of "humor":http://whirlpool.net.au/index.php ;-)
zither last edited by
Some error in code?
@reply = qnam.get(request);@
@reply = qname->get(request);@
you should check, like Lukas Geyer says to check your url reqest.
Thanks Lucas, that definietly got me on the right track - once I set the user agent to "Mozilla ..." etc I started getting info back. Now having problems with the cgi parameters but I'll sort that.
Might have a word with the site admin about the UA requirement - doesn't seem neccessary ...