diff OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp @ 4474:f8c1d94363b6

new configuration options: "AcceptedTransferSyntaxes" and "H265TransferSyntaxAccepted"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Jan 2021 15:50:52 +0100
parents 68f52897c119
children 5fabef29c4ff
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Tue Jan 26 14:48:10 2021 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp	Tue Jan 26 15:50:52 2021 +0100
@@ -372,11 +372,21 @@
       return;
     }
 
-    std::string body;
-    call.BodyToString(body);
+    std::set<DicomTransferSyntax> syntaxes;
 
-    std::set<DicomTransferSyntax> syntaxes;
-    OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, body);
+    Json::Value json;
+    if (call.ParseJsonRequest(json))
+    {
+      std::cout << json.toStyledString();
+      OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, json);
+    }
+    else
+    {
+      std::string body;
+      call.BodyToString(body);
+      OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, body);
+    }
+
     OrthancRestApi::GetContext(call).SetAcceptedTransferSyntaxes(syntaxes);
     
     AnswerAcceptedTransferSyntaxes(call);