# HG changeset patch # User Alain Mazy # Date 1564652784 -7200 # Node ID 9b93ec2c53b26031ad9e18bd3238349d3b02bc33 # Parent f93a9c6c00c5486d40453ae3c983bf7d39e18974# Parent a4f2354f04c36baf360d92e08cb94d0dd3caf245 merge diff -r a4f2354f04c3 -r 9b93ec2c53b2 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- 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, diff -r a4f2354f04c3 -r 9b93ec2c53b2 Plugins/Samples/Common/OrthancPluginCppWrapper.h --- 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& 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,