Mercurial > hg > orthanc
changeset 3479:9b93ec2c53b2
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 01 Aug 2019 11:46:24 +0200 |
parents | f93a9c6c00c5 (diff) a4f2354f04c3 (current diff) |
children | 10fd1b9ae044 df730398978a |
files | |
diffstat | 2 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Jul 31 14:35:58 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Thu Aug 01 11:46:24 2019 +0200 @@ -1249,6 +1249,29 @@ } + bool RestApiPost(std::string& result, + const std::string& uri, + const void* body, + size_t bodySize, + bool applyPlugins) + { + MemoryBuffer answer; + + if (!answer.RestApiPost(uri, body, bodySize, applyPlugins)) + { + return false; + } + else + { + if (!answer.IsEmpty()) + { + result.assign(answer.GetData(), answer.GetSize()); + } + return true; + } + } + + bool RestApiPost(Json::Value& result, const std::string& uri, const void* body,
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Jul 31 14:35:58 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Thu Aug 01 11:46:24 2019 +0200 @@ -468,6 +468,12 @@ const std::map<std::string, std::string>& httpHeaders, bool applyPlugins); + bool RestApiPost(std::string& result, + const std::string& uri, + const void* body, + size_t bodySize, + bool applyPlugins); + bool RestApiPost(Json::Value& result, const std::string& uri, const void* body,