Hi!

I want to write a program that issues get, put, and delete HTTP requests. I tried to use the QNetworkAccessManager to accomplish this, but somehow not even a simple example works for me. Here is my code:

Qt Code:
  1. QNetworkAccessManager nm;
  2. QNetworkReply* nr = nm.get(QNetworkRequest(QUrl(QString("http://www.yahoo.com"))));
  3. while (!nr->isFinished())
  4. {
  5. sleep(10);
  6. qDebug() << nr->isFinished() << nr->error() << (nr->request()).url();
  7. }
To copy to clipboard, switch view to plain text mode 

And the output is:

qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
false 0 QUrl( "http://www.yahoo.com" )
First of all, what are the SSL socket warnings about? I did not want to use an SSL connection here.
I used wireshark to observe the network traffic, and can see that not a single packet leaves my interface when using this code. It is not working.

And yes, I do not want to use the QNetworkManager in an asynchronous mode, I would rather wait in a loop until it is finished.

Can anyone tell me what I'm doing wrong?

Thanks
Cruz