[Geoserver-devel] [JIRA] (GEOS-7401) PUT requests to REST API ignore the Accept header

Cesar Martinez created an issue

GeoServer / BugGEOS-7401

PUT requests to REST API ignore the Accept header

Issue Type:

BugBug

Affects Versions:

2.8.1

Assignee:

Unassigned

Created:

04/Feb/16 12:16 PM

Environment:

Linux Mint 17 Qiana, Tomcat 7.0.52-1ubuntu0.3,
java version “1.7.0_79”
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Priority:

MediumMedium

Reporter:

Cesar Martinez

If we upload a coverage using the REST API, the response is always an XML regardless the Accept header, so it is impossible to get a JSON response:

curl -v -u admin:geoserver -XPUT -H “Accept: application/json” -H “Content-type: image/tiff” --data-binary @mytif.tif http://localhost:8080/geoserver/rest/workspaces/copernicus_nicolaus/coveragestores/mycoverage/file.geotiff

Response:
<coverageStore>
<name>mycoverage</name>
<type>GeoTIFF</type>
<enabled>true</enabled>

</coverageStore>

The ‘Accept’ header should be honoured according to Geoserver documentation:
http://docs.geoserver.org/maintain/en/user/rest/api/details.html#formats-and-representations

“In a POST or PUT operation, the format of content being sent to the server is specified with the Content-type header. For example, to send a representation in XML, use “Content-type: text/xml” or “Content-type: application/xml”. As with GET requests, the representation of the content returned from the server is specified by the Accept header or by the format.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v7.1.0-OD-05-006#71001-sha1:081cc1a)

Atlassian logo