Using a geoserver WMS getcapabilities request

http://localhost:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities&format=text/xml ,

the xml is displayed in the browser, but if we take &format=text/xml the request gives a popup to open/download the xml file.

I am trying to display a geoserver WMTS getcapabilities request,

http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetCapabilities ,

in the browser adding the &format=text/xml, but even with the output format ,


the request still shows a popup to open/download the xml file.

How do I do a wmts getcapabilities showing the xml file in the browser instead of opening a popup?

| improve this question | | | | |

The return type of a GetCapabilities document from a WMS/WMTS service should always be an application specific one of application/vnd.ogc.wms_xml due to there not being a well defined standard mime type when the specification was written. You can confirm this by using curl to inspect the headers.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Frame-Options: SAMEORIGIN
content-disposition: inline;filename=wmts-getcapabilities.xml
Content-Type: application/vnd.ogc.wms_xml;charset=UTF-8
Content-Length: 99487
Date: Wed, 07 Feb 2018 13:45:10 GMT

Your problem is that your browser doesn't know what to do with that mime type. So you will need to go into the settings and define that you want the browser to handle that mime type.

| improve this answer | | | | |
  • thank you for your reply. Firefox gives me only two options to set XML application "Always ask" and "Save File". Some other applications has "Preview in Firefox", except XML. Now, if XML is set to "Always ask", why the request (localhost:8080/geoserver/…) is displayed in the browser? How can I set my curl command to inspect the headers? I tried this curl 'localhost:8080/geoserver/topp/gwc/service/…' -o /tmp/wmts-capabilities.xml, but I did not get the right response. Cheers – HelpOverFlow Feb 7 '18 at 18:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.