incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject _temp_view insists on Content-Type
Date Thu, 02 Apr 2009 19:12:56 GMT
It seems to be inconsistent that a POST to _temp_view only works if
Content-Type: application/json is provided, whereas in every other part of
the API I've exercised so far it's not needed (example below).

I see there is explicit code enforcing this, in
couch_httpd_view:handle_temp_view_req/2

Could someone explain what the reason is for this?

Thanks,

Brian.

$ curl -X POST -d '{"map":"function(doc) { emit(null, null) }"}'
http://127.0.0.1:5984/couchtiny-test/_temp_view
{"error":"incorrect_mime_type","reason":"application/x-www-form-urlencoded"}
$ curl -X POST -d '{"map":"function(doc) { emit(null, null) }"}' -H "Content-Type: application/json"
http://127.0.0.1:5984/couchtiny-test/_temp_view
{"total_rows":3,"offset":0,"rows":[
{"id":"fred","key":null,"value":null},
{"id":"jim","key":null,"value":null},
{"id":"trunky","key":null,"value":null}
]}

Mime
View raw message