[openstack-dev] [api][nova] Handling lots of GET query string parameters?

Cory Benfield cory at lukasa.co.uk
Wed Nov 4 14:11:44 UTC 2015


> On 4 Nov 2015, at 13:13, Salvatore Orlando <salv.orlando at gmail.com> wrote:
> 
> Regarding Jay's proposal, this would be tantamount to defining an API action for retrieving instances, something currently being discussed here [1].
> The only comment I have is that I am not entirely surely whether using the POST verb for operations which do no alter at all the server representation of any object is in accordance with RFC 7231.

It’s totally fine, so long as you define things appropriately. Jay’s suggestion does exactly that, and is entirely in line with RFC 7231.

The analogy here is to things like complex search forms. Many search engines allow you to construct very complex search queries (consider something like Amazon or eBay, where you can filter on all kinds of interesting criteria). These forms are often submitted to POST endpoints rather than GET.

This is totally fine. In fact, the first example from RFC 7231 Section 4.3.3 (POST) applies here: “POST is used for the following functions (among others): Providing a block of data […] to a data-handling process”. In this case, the data-handling function is the search function on the server.

The *only* downside of Jay’s approach is that the response cannot really be cached. It’s not clear to me whether anyone actually deploys a cache in this kind of role though, so it may not hurt too much.

Cory


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151104/d33e279f/attachment.pgp>


More information about the OpenStack-dev mailing list