Here is my code:
Widget::Widget()
{
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
}
void Widget::replyFinished(QNetworkReply* reply)
{
//some other code here
}
I hope that reply will have some method like getrespnsetext() but it not...
Can some one show me an example, all the thing i need is print out the response text (is ther any way like in Javascript Ajax)
Thanks for your help!
You only need to use reply->readAll()
inside the replyFinished(...)
function to read all the returned text. It returns a QByteArray
, so you can do wathever you want from there.