1
這是我使用的代碼:獲取空字符串從QNetworkAccessManager
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("https://dl-web.dropbox.com/get/patcher/wait.txt?w=AACu6t8OAIyonlf6zpLX4VQquumCR5I5Tvukdg_e8gXGxg")));
這是我的槽:
void MainWindow::replyFinished(QNetworkReply* reply)
{
qDebug() << reply->readAll();
}
我得到 「」 作爲輸出。任何理由?
我試圖從link得到文本輸出。
謝謝。我通過將其放入DropBox中的公用文件夾並在https中刪除s來修復它。 – user2305688 2013-04-22 03:48:40
哦,我明白了。另外,如果你想通過https保持通信加密,你仍然可以使用https;但你必須做一個調整你的代碼:QNetworkReply * reply = manager-> get(QNetworkRequest(QUrl(「https://dl-web.dropbox.com/get/patcher/wait.txt?w=AACu6t8OAIyonlf6zpLX4VQquumCR5I5Tvukdg_e8gXGxg」)) )); reply-> ignoreSslErrors(); – Aki 2013-04-22 14:33:36