码迷,mamicode.com
首页 > 数据库 > 详细

qt QNetworkAccessManager https

时间:2016-09-13 01:36:43      阅读:735      评论:0      收藏:0      [点我收藏+]

标签:

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

标签:

原文地址:http://www.cnblogs.com/lz20150121/p/5866985.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!