Try to use this
Qt Code:
  1. void TestClass::onRequestFinished(QNetworkReply* reply)
  2. {
  3.  
  4. if(reply->error())
  5. {
  6. qDebug() << "ERROR : " << reply->errorString();
  7. }
  8. else
  9. {
  10. qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
  11. qDebug() << reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
  12.  
  13. QString strReply = reply->readAll();
  14. qDebug() << strReply;
  15. // ....
  16.  
  17.  
  18. }
  19. reply->deleteLater();
  20.  
  21. }
To copy to clipboard, switch view to plain text mode