Dicom web plugin request error

I just installed DicomWeb plugin and trying to request studies using REST API

http://<myip>:8042/dicom-web/studies

and it ends with the following error :

PluginsManager.cpp:163] Unsupported return MIME type: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8, will return XML

Is it a bug or a config problem ?

Hello,

DICOMweb cannot be used directly inside Web browsers, as the browsers do not know how to handle the “application/dicom+xml” MIME type that is prescribed by the standard.

You will have to use either a command-line tool (such as “curl”), a HTTP toolkit (such as Python), or a JavaScript/AJAX script (e.g. through jquery) to query DICOMweb.

Python and JavaScript samples are available:
https://bitbucket.org/sjodogne/orthanc-dicomweb/src/default/Resources/Samples/

HTH,
Sébastien-

The browser handles JSON responses just fine, I can’t think of any reason for a browser to request the XML encoding (unless the server doesn’t support JSON encoding)

Last year I created a DICOMWeb WADO-RS RetrieveMetadata to FHIR ImagingStudy resource generator which you might find useful:

https://github.com/chafey/DICOMToFHIRImagingStudy

It shows how to make an XHR to a DICOMWeb server from JavaScript and parse the result. I know this worked against DCM4CHEE but don’t recall if I tested it against Orthanc.

Yes, the Orthanc server does support JSON encoding.

However, as the Web browser does not indicate that it accepts “application/json” in the HTTP headers of the request, Orthanc defaults to “application/dicom+xml”. This is the behavior I observe with Chromium and Firefox.

XHR allows you to specify HTTP request headers, here is where I do this (actually with jQuery’s AJAX wrapper on XHR):

https://github.com/chafey/DICOMToFHIRImagingStudy/blob/master/src/main.js#L42

Yes, this what the sense of my first answer, where I talked about the possibility of using AJAX for that purpose:
https://groups.google.com/d/msg/orthanc-users/GUV6uzWix1E/iH9hJZ6mAQAJ

Thanks for clarifying my answer :slight_smile: