Making an HTTP GET under Qt

前端 未结 2 1311
予麋鹿
予麋鹿 2020-12-10 07:13

I have kind of a n00b problem, I can\'t seem to make HTTP GET requests from my Qt Code...

Here is the code supposed to work:

void MainWindow::request         


        
2条回答
  •  星月不相逢
    2020-12-10 08:03

    If reply->error() = 0, it means the request was successful. In fact, your code seems right to me, and the only thing I would do differently is to read the data. Try with this:

    QByteArray rawData = reply->readAll();
    QString textData(rawData);
    qDebug() << textData;
    

提交回复
热议问题