Uploaded image for project: 'GeoServer'
  1. GEOS-3946

Updating a coveragestore via REST returns 201 rather than 200

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.12-beta
    • Component/s: REST
    • Labels:
      None

      Description

      When I update an existing coverage store, I expect a PUT to return a 200 response as described in the API documentation :
      Instead, the REST service returns a 201 response.

      First, I create a coveragestore via POST. 201 response is as expected.

      $ curl -v -XPOST --basic --user admin:geoserver -H 'Content-Type: application/xml' -d '<coverageStore><name>radar_sample</name><workspace>leads</workspace><enabled>true</enabled></coverageStore>' http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores - http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores

      • About to connect() to localhost port 8080 (#0)
      • Trying ::1... Connection refused
      • Trying fe80::1... Connection refused
      • Trying 127.0.0.1... connected
      • Connected to localhost (127.0.0.1) port 8080 (#0)
      • Server auth using Basic with user 'admin'
        > POST /geoserver/rest/workspaces/leads/coveragestores HTTP/1.1
        > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
        > User-Agent: curl/7.20.0 (i386-apple-darwin9.8.0) libcurl/7.20.0 OpenSSL/0.9.8n zlib/1.2.4 libidn/1.16
        > Host: localhost:8080
        > Accept: <b>/</b>
        > Content-Type: application/xml
        > Content-Length: 107
        >
        < HTTP/1.1 201 Created
        < Date: Wed, 05 May 2010 20:22:24 GMT
        < Location: http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores/radar_sample - http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores/radar_sample
        < Server: Noelios-Restlet-Engine/1.0..8
        < Transfer-Encoding: chunked
        <
      • Connection #0 to host localhost left intact
      • Closing connection #0

      Next... update the coverage store via PUT. Server returns 201 rather than the expected (and documented) 200. This is incorrect since nothing new has been 'created'.

      $ curl -v -XPUT --basic --user admin:geoserver -H 'Content-type: text/plain' -d 'file:/Users/alex/radar_sample.tif' http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores/radar_sample/external.geotiff?configure=first&amp;coverageName=radar_sample - http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores/radar_sample/external.geotiff?configure=first\&amp;coverageName=radar_sample

      • About to connect() to localhost port 8080 (#0)
      • Trying ::1... Connection refused
      • Trying fe80::1... Connection refused
      • Trying 127.0.0.1... connected
      • Connected to localhost (127.0.0.1) port 8080 (#0)
      • Server auth using Basic with user 'admin'
        > PUT /geoserver/rest/workspaces/leads/coveragestores/radar_sample/external.geotiff?configure=first&coverageName=radar_sample HTTP/1.1
        > Authorization: Basic YWRtaW46Z2Vvc2VydmVy
        > User-Agent: curl/7.20.0 (i386-apple-darwin9.8.0) libcurl/7.20.0 OpenSSL/0.9.8n zlib/1.2.4 libidn/1.16
        > Host: localhost:8080
        > Accept: <b>/</b>
        > Content-type: text/plain
        > Content-Length: 33
        >
        < HTTP/1.1 201 Created
        < Date: Wed, 05 May 2010 20:23:37 GMT
        < Server: Noelios-Restlet-Engine/1.0..8
        < Content-Type: application/xml
        < Transfer-Encoding: chunked
        <
        <coverageStore>
        <name>radar_sample</name>
        <type>GeoTIFF</type>
        <enabled>true</enabled>
        <workspace>
        <name>leads</name>
        <href>http://localhost:8080/geoserver/rest/workspaces/WorkspaceInfoImpl--7a1d8d2c:12817857b4f:-8000.xml - http://localhost:8080/geoserver/rest/workspaces/WorkspaceInfoImpl--7a1d8d2c:12817857b4f:-8000.xml&lt;/href&gt;
        </workspace>
        <url>file:/Users/alex/radar_sample.tif - file:/Users/alex/radar_sample.tif&lt;/url&gt;
        <coverages>
        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/leads/coveragestores/radar_sample/external/coverages.xml" type="application/xml"/>
        </coverages>
      • Connection #0 to host localhost left intact
      • Closing connection #0

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              harrison.grundy codehaus (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: