changeset 1760:e38b9875a969

adaptation to change in API of Orthanc::HttpClient
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 May 2021 11:02:24 +0200
parents 7428da2bb94d
children 28755e42c007
files OrthancStone/Sources/Oracle/GenericOracleRunner.cpp OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Oracle/GenericOracleRunner.cpp	Mon Apr 26 20:43:00 2021 +0200
+++ b/OrthancStone/Sources/Oracle/GenericOracleRunner.cpp	Tue May 04 11:02:24 2021 +0200
@@ -127,10 +127,12 @@
     if (command.GetMethod() == Orthanc::HttpMethod_Post ||
         command.GetMethod() == Orthanc::HttpMethod_Put)
     {
-      client.SetBody(command.GetBody());
+      client.SetExternalBody(command.GetBody());
     }
 
     client.ApplyAndThrowException(answer, answerHeaders);
+    client.ClearBody();
+
     DecodeAnswer(answer, answerHeaders);
   }
 
@@ -163,10 +165,11 @@
     if (command.GetMethod() == Orthanc::HttpMethod_Post ||
         command.GetMethod() == Orthanc::HttpMethod_Put)
     {
-      client.SetBody(command.GetBody());
+      client.SetExternalBody(command.GetBody());
     }
 
     client.ApplyAndThrowException(answer, answerHeaders);
+    client.ClearBody();
     DecodeAnswer(answer, answerHeaders);
   }
 
--- a/OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp	Mon Apr 26 20:43:00 2021 +0200
+++ b/OrthancStone/Sources/Toolbox/OrthancDatasets/OrthancHttpConnection.cpp	Tue May 04 11:02:24 2021 +0200
@@ -66,8 +66,9 @@
 
     client_.SetMethod(Orthanc::HttpMethod_Post);
     client_.SetUrl(url_ + uri);
-    client_.SetBody(body);
+    client_.SetExternalBody(body);
     client_.ApplyAndThrowException(result);
+    client_.ClearBody();
   }
 
 
@@ -79,8 +80,9 @@
 
     client_.SetMethod(Orthanc::HttpMethod_Put);
     client_.SetUrl(url_ + uri);
-    client_.SetBody(body);
+    client_.SetExternalBody(body);
     client_.ApplyAndThrowException(result);
+    client_.ClearBody();
   }