# HG changeset patch # User Alain Mazy # Date 1564652761 -7200 # Node ID f93a9c6c00c5486d40453ae3c983bf7d39e18974 # Parent 3355a2c060c4becc5a8f57da8b16e2ef00fa072e added RestApiPost overload to retrieve a string response diff -r 3355a2c060c4 -r f93a9c6c00c5 Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Mon Jul 15 16:48:36 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Thu Aug 01 11:46:01 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 3355a2c060c4 -r f93a9c6c00c5 Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Mon Jul 15 16:48:36 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Thu Aug 01 11:46:01 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,