Dicom web plugin request error

871 views
Skip to first unread message

Marc Delpont

unread,
Feb 11, 2016, 9:57:47 AM2/11/16
to Orthanc Users
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 ?

Sébastien Jodogne

unread,
Feb 11, 2016, 1:15:50 PM2/11/16
to Orthanc Users
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:

HTH,
Sébastien-

Chris Hafey

unread,
Feb 12, 2016, 10:44:13 AM2/12/16
to Orthanc Users
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)

Chris Hafey

unread,
Feb 12, 2016, 10:48:53 AM2/12/16
to Orthanc Users
Last year I created a DICOMWeb WADO-RS RetrieveMetadata to FHIR ImagingStudy resource generator which you might find useful:


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.

Sébastien Jodogne

unread,
Feb 12, 2016, 10:55:04 AM2/12/16
to Orthanc Users
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.

Chris Hafey

unread,
Feb 12, 2016, 11:05:45 AM2/12/16
to Orthanc Users
XHR allows you to specify HTTP request headers, here is where I do this (actually with jQuery's AJAX wrapper on XHR):

Sébastien Jodogne

unread,
Feb 12, 2016, 11:08:07 AM2/12/16
to Orthanc Users
Yes, this what the sense of my first answer, where I talked about the possibility of using AJAX for that purpose:

Thanks for clarifying my answer :)
Reply all
Reply to author
Forward
0 new messages