一 前言
先说 结论,编译64位报错,查了一圈没找到解决方案,最后换了32位的。
使用qt访问web接口,因为是https,没有openssl库会报错
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
if (reply)
{
if (reply->error() == QNetworkReply::NoError)
{
// 处理成功响应
QByteArray responseData = reply->readAll();
// 处理responseData
ui->textEdit->append("data:" + QString::fromUtf8(responseData) + "\n");
}
else
{
// 处理错误响应
qDebug() << "Request Error: " << reply->errorString();
ui->textEdit->append("error:" + mReply->errorString());
}
reply->deleteLater();
}
错误就是 error:Error creating SSL context ()
说明需要openssl
使用下面代码查看qt需要的库
QSs