Mercurial > hg > orthanc
comparison Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 3478:f93a9c6c00c5
added RestApiPost overload to retrieve a string response
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 01 Aug 2019 11:46:01 +0200 |
parents | 0371b65d5f76 |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3474:3355a2c060c4 | 3478:f93a9c6c00c5 |
---|---|
1247 return true; | 1247 return true; |
1248 } | 1248 } |
1249 } | 1249 } |
1250 | 1250 |
1251 | 1251 |
1252 bool RestApiPost(std::string& result, | |
1253 const std::string& uri, | |
1254 const void* body, | |
1255 size_t bodySize, | |
1256 bool applyPlugins) | |
1257 { | |
1258 MemoryBuffer answer; | |
1259 | |
1260 if (!answer.RestApiPost(uri, body, bodySize, applyPlugins)) | |
1261 { | |
1262 return false; | |
1263 } | |
1264 else | |
1265 { | |
1266 if (!answer.IsEmpty()) | |
1267 { | |
1268 result.assign(answer.GetData(), answer.GetSize()); | |
1269 } | |
1270 return true; | |
1271 } | |
1272 } | |
1273 | |
1274 | |
1252 bool RestApiPost(Json::Value& result, | 1275 bool RestApiPost(Json::Value& result, |
1253 const std::string& uri, | 1276 const std::string& uri, |
1254 const void* body, | 1277 const void* body, |
1255 size_t bodySize, | 1278 size_t bodySize, |
1256 bool applyPlugins) | 1279 bool applyPlugins) |