Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/OrthancApiClient.cpp @ 502:3ae7563b4fe1 am-touch-events
more orthancApiClient overloads
author | amazy |
---|---|
date | Mon, 25 Feb 2019 17:57:37 +0100 |
parents | a750f11892ec |
children | 4f2416d519b4 |
comparison
equal
deleted
inserted
replaced
492:64d90190a08c | 502:3ae7563b4fe1 |
---|---|
246 const std::string& body) | 246 const std::string& body) |
247 { | 247 { |
248 web_.PostAsync(baseUrl_ + uri, IWebService::HttpHeaders(), body, NULL, NULL, NULL); | 248 web_.PostAsync(baseUrl_ + uri, IWebService::HttpHeaders(), body, NULL, NULL, NULL); |
249 } | 249 } |
250 | 250 |
251 void OrthancApiClient::PostBinaryAsync( | |
252 const std::string& uri, | |
253 const std::string& body, | |
254 MessageHandler<EmptyResponseReadyMessage>* successCallback, | |
255 MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, | |
256 Orthanc::IDynamicObject* payload /* takes ownership */) | |
257 { | |
258 web_.PostAsync(baseUrl_ + uri, IWebService::HttpHeaders(), body, | |
259 new WebServicePayload(successCallback, failureCallback, payload), | |
260 new Callable<OrthancApiClient, IWebService::HttpRequestSuccessMessage> | |
261 (*this, &OrthancApiClient::NotifyHttpSuccess), | |
262 new Callable<OrthancApiClient, IWebService::HttpRequestErrorMessage> | |
263 (*this, &OrthancApiClient::NotifyHttpError)); | |
264 } | |
265 | |
251 void OrthancApiClient::PostJsonAsyncExpectJson( | 266 void OrthancApiClient::PostJsonAsyncExpectJson( |
252 const std::string& uri, | 267 const std::string& uri, |
253 const Json::Value& data, | 268 const Json::Value& data, |
254 MessageHandler<JsonResponseReadyMessage>* successCallback, | 269 MessageHandler<JsonResponseReadyMessage>* successCallback, |
255 MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, | 270 MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, |
265 const Json::Value& data) | 280 const Json::Value& data) |
266 { | 281 { |
267 std::string body; | 282 std::string body; |
268 MessagingToolbox::JsonToString(body, data); | 283 MessagingToolbox::JsonToString(body, data); |
269 return PostBinaryAsync(uri, body); | 284 return PostBinaryAsync(uri, body); |
285 } | |
286 | |
287 void OrthancApiClient::PostJsonAsync( | |
288 const std::string& uri, | |
289 const Json::Value& data, | |
290 MessageHandler<EmptyResponseReadyMessage>* successCallback, | |
291 MessageHandler<IWebService::HttpRequestErrorMessage>* failureCallback, | |
292 Orthanc::IDynamicObject* payload /* takes ownership */) | |
293 { | |
294 std::string body; | |
295 MessagingToolbox::JsonToString(body, data); | |
296 return PostBinaryAsync(uri, body, successCallback, failureCallback, payload); | |
270 } | 297 } |
271 | 298 |
272 void OrthancApiClient::DeleteAsync( | 299 void OrthancApiClient::DeleteAsync( |
273 const std::string& uri, | 300 const std::string& uri, |
274 MessageHandler<EmptyResponseReadyMessage>* successCallback, | 301 MessageHandler<EmptyResponseReadyMessage>* successCallback, |