I am working with the geoserver rest interface to automate the config of all layers, stores etc. One thing I noticed was that when using a browser and navigating to a layer the outcome is something like the information below:

Sample url: http://SomeServer/geoserver/rest/layers/SomeLayer.html

Layer "SomeLayer"

    Name: SomeLayer
    Default style: StyleInfoImpl[layerStyle]
    Available styles: []

When using the same url but through cURL I get:

curl -v -u user:password -XGET http://SomeServer/geoserver/rest/layers/SomeLayer -H "accept: application/xml" -H "content-type: application/json"

  <resource class="featureType">
    <entry key="GWC.autoCacheStyles">true</entry>
    <entry key="GWC.metaTilingX">4</entry>
    <entry key="GWC.metaTilingY">4</entry>
    <entry key="GWC.gutter">0</entry>
    <entry key="advertised">true</entry>
    <entry key="GWC.enabled">true</entry>
    <entry key="GWC.cacheFormats">image/png,image/jpeg</entry>
    <entry key="GWC.gridSets">EPSG:4326,EPSG:900913</entry>

When using cURL I get much more attributes such as "enabled", "Queryable" and "Metadata".

Is this normal behaviour, am I missing something when navigating to the layer information in a browser? I am using geoserver 2.12, but I have noticed this behavior already in 2.1.

1 Answer 1


Actually, this has nothing to do with the way you make the request. RESTful services can provide different representations of their state depending on the output format you request. So the information you get back is the same in the browser and the command line if you go to a URL like:


in the browser or using CURL (or you can drop the .xml in CURL and add -H "accept: application/xml"). If however, you go to


You will get the HTML representation back, this has less information in it as it's designed for humans not machines. In this case, you will see the HTML by default in the web browser if you don't specify the extension as that is what browsers expect to get.

  • Thanks, This works. I have added .xml in my browser and all other atributes are returned, just like with a cURL statement
    – Freeze
    Commented Feb 2, 2018 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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