pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: RESTFul
Date Thu, 24 Mar 2011 13:02:14 GMT
> For HTTP 409 the standard recomends to put additional information in the body: 
> Don't you think is more appropriate to modify the execute method in Query.java to permit
the return of the response body for every kind of query and not only for the GET?

Possibly, but my feeling is no. The primary purpose of the web query API is to map the CRUD
operations to HTTP in a relatively object-oriented manner:

GET = read
POST = create
PUT = create/update
DELETE = delete

As such, the API is geared towards this definition:

- GetQuery returns the value of an existing resource
- PostQuery creates a new resource and returns a URL 
- PutQuery either creates a new resource or updates an existing one
- DeleteQuery deletes an existing resource

The primary distinction between POST and PUT is that, for a POST, the server provides the
name of the resource, and for a PUT, the caller provides it. As a result, PostQuery returns
a URL representing the location of the new resource, and PutQuery returns a Boolean to indicate
whether the operation created or updated the named resource (note that not all implementations
will necessarily support both). HTTP headers are used to convey any additional detail about
the response.

Hope this helps.


View raw message