MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / syntheticRubyOnRailsDelete

Method syntheticRubyOnRailsDelete

src/network/UBServerXMLHttpRequest.cpp:179–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179void UBServerXMLHttpRequest::syntheticRubyOnRailsDelete(const QUrl& pUrl)
180{
181 if (mIsRunning)
182 {
183 qDebug() << this << "already running ...";
184 return;
185 }
186
187 mIsRunning = true;
188
189 mReplyContent.clear();
190 mHasError = false;
191
192 QNetworkRequest request(pUrl);
193
194 request.setHeader(QNetworkRequest::ContentTypeHeader, mContentType);
195 request.setRawHeader("ACCEPT", "application/xml");
196 request.setRawHeader("X_HTTP_METHOD_OVERRIDE", "delete");
197
198 foreach(QString key, mExtraHeaders.keys())
199 {
200 request.setRawHeader(key.toUtf8(), mExtraHeaders.value(key).toUtf8());
201 }
202
203 if (mIsVerbose)
204 qDebug() << "deleting to" << pUrl;
205
206 QString fakePayload;
207 fakePayload += "<fake/>";
208
209 mReply = mNam->post(request, fakePayload.toUtf8()); // UB 4.2 TODO who owns and delete the reply ?
210
211 connectReply();
212
213}
214
215
216void UBServerXMLHttpRequest::connectReply()

Callers

nothing calls this directly

Calls 2

postMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected