| 20 | } |
| 21 | |
| 22 | bool WizJSONServerBase::get(const QString& strUrl, QString& strResult) |
| 23 | { |
| 24 | QNetworkReply* reply = m_net->get(QNetworkRequest(strUrl)); |
| 25 | WizAutoTimeOutEventLoop loop(reply); |
| 26 | loop.exec(); |
| 27 | // |
| 28 | if (loop.error() != QNetworkReply::NoError) |
| 29 | { |
| 30 | qDebug() << "[JSONRequest]Send get request failed."; |
| 31 | return false; |
| 32 | } |
| 33 | |
| 34 | strResult = QString::fromUtf8(loop.result().constData()); |
| 35 | return !strResult.isEmpty(); |
| 36 | } |
| 37 | |
| 38 | bool WizJSONServerBase::deleteResource(const QString& strUrl) |
| 39 | { |
no test coverage detected