我想使用 bb 级联创建一个 BB10 应用程序,我想通过 QNetWork http 请求将用户名和密码传递给服务器。我尝试了以下
QNetworkRequest request = QNetworkRequest();
request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");
request.setRawHeader("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
request.setRawHeader("Content-Language", "en-US");
QString concatenated = "username:password";
QByteArray data = concatenated.toLocal8Bit().toBase64();
QString headerData = "Basic " + data;
req.setRawHeader("Authorization", headerData.toLocal8Bit());
QSslConfiguration config = request.sslConfiguration();
config.setPeerVerifyMode(QSslSocket::VerifyNone);
config.setProtocol(QSsl::TlsV1);
request.setSslConfiguration(config);
但这给了我一个 QNetworkReply 错误 202( ContentOperationNotPermittedError
)。这个错误的原因是什么?我该如何解决这个问题?
提前致谢