QT QNetworkAccessManager请求响应为空

QString currentTime =QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss.zzz ddd");
text_stream << currentTime <<" reply->url().toString(): "<<reply->url().toString() << "\r\n";
text_stream << currentTime <<" reply->error(): "<<reply->error() << "\r\n";
text_stream << currentTime <<" reply->request().url().toString(): "<<reply->request().url().toString() << "\r\n";
text_stream << currentTime <<" reply->request().rawHeader(jwt-token): "<<reply->request().rawHeader("jwt-token") << "\r\n";
text_stream << currentTime <<" reply->request().rawHeader(alarm-mode): "<<reply->request().rawHeader("alarm-mode") << "\r\n";
text_stream << currentTime <<" reply->request().rawHeader(user-name): "<<reply->request().rawHeader("user-name") << "\r\n";
text_stream << currentTime <<" reply->isRunning(): "<<reply->isRunning() << "\r\n";
text_stream << currentTime <<" reply->isFinished(): "<<reply->isFinished() << "\r\n";
text_stream << currentTime <<" reply->rawHeader(jwt-token): "<<reply->rawHeader("jwt-token") << "\r\n";
text_stream << currentTime <<" reply->rawHeader(alarm-mode): "<<reply->rawHeader("alarm-mode") << "\r\n";
text_stream << currentTime <<" reply->rawHeader(jwt-token): "<<reply->rawHeader("jwt-token") << "\r\n";
text_stream << currentTime <<" reply->Text: "<<reply->Text << "\r\n";
text_stream << currentTime <<" reply->readAll(): "<<reply->readAll() << "\r\n";




file.flush();
file.close();

根据针对QNetworkReply的分析,

2020.07.31 11:24:49.144 周五 request.sslConfiguration().peerVerifyMode(): 3
2020.07.31 11:24:49.313 周五 reply->url().toString(): sas
2020.07.31 11:24:49.313 周五 reply->error(): 6

QT QNetworkAccessManager请求响应为空

 

 

QSslSocket::setPeerVerifyMode(QSslSocket::PeerVerifyMode mode);

查看当前模式版本

2020.07.31 11:24:49.144 周五 request.sslConfiguration().peerVerifyMode(): 3

 

 

可以通过如下跳过验证

QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setPeerVerifyMode(QSslSocket::VerifyNone);
request.setSslConfiguration(config);

 

QT QNetworkAccessManager请求响应为空

上一篇:C#中DataTable转换JSON


下一篇:C# 创建 windows服务(转)