couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kore Nordmann <>
Subject Re: [PATCH] Views: Multiple keys
Date Tue, 04 Nov 2008 23:19:38 GMT
Chris Anderson wrote:
> On Tue, Nov 4, 2008 at 2:41 PM, Kore Nordmann <> wrote:
>> I would actually prefer using GET with a request body for fetching view
>> results with multiple keys, since otherwise the semantics [1] of POST
>> requests are violated.
> I agree, GET would be nice. Perhaps we should support GET (via url
> params) as well as POST.
>> Starting with using the HTTP methods in a
>> different meaning then they have been developed for, just because of
>> potential implementation details, may open a can of worms, breaking the
>> whole HTTP standard.
> I don't think the situation is as dire as this. There's an argument
> that because multi-key view requests are in effect asking the server
> to do a lot of processing, POST is appropriate. GET is suitable only
> if we're willing to accept limitations the number of keys (remember, a
> single key can be arbitrarily long) based on practical URL length
> limitations.

Allowing both, keys as URL parameters and inside the body, as well as
GET and POST as the used HTTP method sounds like a very well option. So
the user can chose the method he wants and fall back to the other way,
if there are issues with that.

I would then suggest something like ?key=["foo", "bar"], and also allow
specifying all the other view parameters in the JSON struct included in
the request body for POST requests. This would be a quite consistent
solution, I guess.

Kind regards,

Kore Nordmann                                        (GPG 0xDDC70BBB)

View raw message