PDA

View Full Version : QNetworkAccessManager and QHttp doesn't sends anything



corrado
29th May 2010, 12:39
Hi everyone,

i wrote some app and trying with a help of QNetworkAccessManager send some data to server using POST request, however nothing happen at all. I tried to use QHttp and the same result. I have checked it with WireShark - none requests in the list from my program. I tried to send GET request and the same - none requests. I created project with Network libs, got example from help:

manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(requesReply(QNetworkReply*)));

QNetworkRequest req;
req.setUrl(QUrl("http://server.net/upload"));
manager->get(req);

Please help me to find what i'm missing.

Thanks in advance

alexisdm
29th May 2010, 14:09
Did you test to see if there was an error ?

void YourClass::requesReply(QNetworkReply* reply)
{
reply->deleteLater();
if (reply->error() != QNetworkReply::NoError)
{
QMessageBox::critical(0, "NetworkError", reply->errorString());
return;
}
...
}

ChrisW67
29th May 2010, 22:20
"Server.net" does not have an address record?