comparison 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
comparison
equal deleted inserted replaced
4473:68f52897c119 4474:f8c1d94363b6
370 "UIDs to be accepted. Wildcards `?` and `*` are accepted.") 370 "UIDs to be accepted. Wildcards `?` and `*` are accepted.")
371 .AddAnswerType(MimeType_Json, "JSON array containing the now-accepted transfer syntax UIDs"); 371 .AddAnswerType(MimeType_Json, "JSON array containing the now-accepted transfer syntax UIDs");
372 return; 372 return;
373 } 373 }
374 374
375 std::string body;
376 call.BodyToString(body);
377
378 std::set<DicomTransferSyntax> syntaxes; 375 std::set<DicomTransferSyntax> syntaxes;
379 OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, body); 376
377 Json::Value json;
378 if (call.ParseJsonRequest(json))
379 {
380 std::cout << json.toStyledString();
381 OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, json);
382 }
383 else
384 {
385 std::string body;
386 call.BodyToString(body);
387 OrthancConfiguration::ParseAcceptedTransferSyntaxes(syntaxes, body);
388 }
389
380 OrthancRestApi::GetContext(call).SetAcceptedTransferSyntaxes(syntaxes); 390 OrthancRestApi::GetContext(call).SetAcceptedTransferSyntaxes(syntaxes);
381 391
382 AnswerAcceptedTransferSyntaxes(call); 392 AnswerAcceptedTransferSyntaxes(call);
383 } 393 }
384 394