changeset 1776:d3d883c3af65

backward compatibility with Orthanc framework <= 1.9.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 May 2021 07:34:14 +0200
parents fca942f4b4a7
children d9c5474c5588
files OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp	Wed May 12 19:57:50 2021 +0200
+++ b/OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp	Fri May 14 07:34:14 2021 +0200
@@ -66,9 +66,15 @@
 
     client_.SetMethod(Orthanc::HttpMethod_Post);
     client_.SetUrl(url_ + uri);
+
+#if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
     client_.ApplyAndThrowException(result);
     client_.ClearBody();
+#else
+    client_.SetBody(body);
+    client_.ApplyAndThrowException(result);
+#endif
   }
 
 
@@ -80,9 +86,15 @@
 
     client_.SetMethod(Orthanc::HttpMethod_Put);
     client_.SetUrl(url_ + uri);
+
+#if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
     client_.ApplyAndThrowException(result);
     client_.ClearBody();
+#else
+    client_.SetBody(body);
+    client_.ApplyAndThrowException(result);
+#endif
   }