Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ApplicationUI::getHTMLInfo()
- {
- QNetworkAccessManager *mgr = new QNetworkAccessManager(this);
- QObject::connect(mgr,
- SIGNAL(finished(QNetworkReply*)),
- this,
- SLOT(processHTMLPage(QNetworkReply*)));
- QNetworkRequest request = QNetworkRequest();
- request.setUrl(QUrl(myURL));
- qDebug() << "Getting the following URL: " << myURL;
- mgr -> get(request);
- }
- void ApplicationUI::processHTMLPage(QNetworkReply* reply)
- {
- qDebug() << "ProcessHTMLPage method has run";
- QByteArray payload = reply->readAll();
- qDebug() << "size of payload is: " << payload.size();
- QString str = QString::fromUtf8(payload.data(), payload.size());
- qDebug() << str;
- reply -> deleteLater();
- }
- ============================
- RESULTS
- ============================
- Getting the following URL: "http://t.co/zJcHz6y4ve"
- ProcessHTMLPage method has run
- size of payload is: 0
- ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement