首页 > 代码库 > qt QNetworkAccessManager https

qt QNetworkAccessManager https

QString para = QString("?mac=%1&bd=%2&uid=%3&frpoc=%4").arg(gMac).arg(gBarid).arg(gUid).arg(nowProcName);
    QUrl url(QString("%1%2").arg(chkPopupAdUrl).arg(para));
    QByteArray byte_array;
    QNetworkAccessManager manager;
    QEventLoop loop;
    QNetworkRequest request;
    QSslConfiguration config;
    config.setPeerVerifyMode(QSslSocket::VerifyNone);
    config.setProtocol(QSsl::SslV3);
    request.setSslConfiguration(config);
    request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json"));
    request.setUrl(url);
    QNetworkReply *reply = manager.get(request);
    reply->ignoreSslErrors();
    QObject::connect(reply,SIGNAL(finished()),&loop,SLOT(quit()));
    loop.exec();
    byte_array = reply->readAll();
    QString popstr = byte_array;

qt QNetworkAccessManager https