On Mon, Jul 9, 2012 at 8:01 PM, Juan Marín Otero
<juan.marin.otero@anonymised.com> wrote:
All,
With the migration to Git and creation of branch 2.2.x done, I'd like to
gather feedback on a proposed enhancement to the REST API that I worked on a
few weeks ago, which adds configuration options for global settings and OWS
services. I wrote a GSIP with the high level description of changes
introduced at the following URL:
http://geoserver.org/display/GEOS/GSIP+76+-+Extend+REST+API+to+configure+settings+and+OWS+services
The associated patch with unit tests and documentation for these changes is
attached in the corresponding JIRA ticket at:
https://jira.codehaus.org/browse/GEOS-5122
Looking good, I have one question related to how the REST interface is used.
As far as I can see a POST is allowed if the settings to be configured
is missing,
and a PUT only if it's already there, see for references:
http://stackoverflow.com/questions/630453/put-vs-post-in-rest
http://jcalcote.wordpress.com/2008/10/16/put-or-post-the-rest-of-the-story/
As far as I know PUT can be used also for resource creation in REST, the
discriminant between using POST and PUT is that with POST you don't
know where the resource is going to end up, while with PUT you already
know the location at which the resource should be created.
Given that the settings have fixed locations that can be foreseen, wouldn't
it make more sense to just use PUT for both creation and updates,
and remove POST support?
Cheers
Andrea
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf