changeset 2267:f915aff7a866

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 Feb 2017 13:32:05 +0100
parents a344e47e9c9a
children ce5c13b95dac
files Plugins/Samples/Common/OrthancPluginCppWrapper.cpp
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Tue Feb 14 16:03:18 2017 +0100
+++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp	Wed Feb 22 13:32:05 2017 +0100
@@ -317,9 +317,10 @@
                               const std::string& password)
   {
     Clear();
-    return CheckHttp(OrthancPluginHttpGet(context_, &buffer_, url.c_str(),
-                                          username.empty() ? NULL : username.c_str(),
-                                          password.empty() ? NULL : password.c_str()));
+    return CheckHttp(OrthancPluginHttpPost(context_, &buffer_, url.c_str(),
+                                           body.c_str(), body.size(),
+                                           username.empty() ? NULL : username.c_str(),
+                                           password.empty() ? NULL : password.c_str()));
   }
   
  
@@ -1130,10 +1131,15 @@
                                         unsigned int minor,
                                         unsigned int revision)
   {
-    char buf[128];
-    sprintf(buf, "Your version of the Orthanc core (%s) is too old to run this plugin (%d.%d.%d is required)",
-            context->orthancVersion, major, minor, revision);
-    OrthancPluginLogError(context, buf);
+    std::string s = ("Your version of the Orthanc core (" +
+                     std::string(context->orthancVersion) +
+                     ") is too old to run this plugin (" +
+                     boost::lexical_cast<std::string>(major) + "." +
+                     boost::lexical_cast<std::string>(minor) + "." +
+                     boost::lexical_cast<std::string>(revision) + 
+                     " is required)");
+    
+    OrthancPluginLogError(context, s.c_str());
   }