56 doRemoveFinishedRequests();
60#ifdef QTBOT_PRINT_RQUESTS
64 QSharedPointer<QNetworkReply> networkReplay;
65 QSharedPointer<QHttpMultiPart> httpData;
67 switch (rquest->method()) {
69 auto reply = _manager->get(QNetworkRequest(url));
72 reply->setParent(
nullptr);
74 networkReplay.reset(reply);
84 QNetworkRequest netRequest(url);
86 httpData = rquest->argsToMultipartFormData();
88 auto reply = _manager->post(netRequest, httpData.data());
91 reply->setParent(
nullptr);
93 networkReplay.reset(reply);
101 size_t address =
reinterpret_cast<size_t>(networkReplay.get());
102 _replayStorage[address] = networkReplay;
104 connect(networkReplay.get(), &QNetworkReply::finished,
this,
105 [
this, address, httpData]() {
106 _toRemove.push_back(address);
109 connect(networkReplay.get(), &QNetworkReply::errorOccurred,
this,
110 [
this, address](QNetworkReply::NetworkError err){
111 qWarning() <<
"The reqeust " << address <<
" finished with error code : " << err;
112 if (auto&& replay = _replayStorage.value(address)) {
113 qWarning() << replay->errorString();
116 _toRemove.push_back(address);
119 return networkReplay;