diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-03-05 19:47:25 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-03-05 19:47:25 +0000 |
commit | e8ca9805f1ea6fb13cb7255ea90b127ac3b8201f (patch) | |
tree | 8868421cfd545f3bba2ff3d83e83aaf8fcd04d78 /src/couchdb/couch_httpd_external.erl | |
parent | 85323384336056cd500ac628c5a69d55635b3de6 (diff) |
allow multi-key POST requests for _list.
closes COUCHDB-269. thanks Jason Davies
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@750565 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_external.erl')
-rw-r--r-- | src/couchdb/couch_httpd_external.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_external.erl b/src/couchdb/couch_httpd_external.erl index 2e25705b..22936e1f 100644 --- a/src/couchdb/couch_httpd_external.erl +++ b/src/couchdb/couch_httpd_external.erl @@ -56,9 +56,13 @@ process_external_req(HttpReq, Db, Name) -> json_req_obj(#httpd{mochi_req=Req, method=Verb, - path_parts=Path + path_parts=Path, + req_body=ReqBody }, Db) -> - ReqBody = Req:recv_body(), + Body = case ReqBody of + undefined -> Req:recv_body(); + Else -> Else + end, ParsedForm = case Req:get_primary_header_value("content-type") of "application/x-www-form-urlencoded" ++ _ -> mochiweb_util:parse_qs(ReqBody); @@ -74,7 +78,7 @@ json_req_obj(#httpd{mochi_req=Req, {<<"path">>, Path}, {<<"query">>, to_json_terms(Req:parse_qs())}, {<<"headers">>, to_json_terms(Hlist)}, - {<<"body">>, ReqBody}, + {<<"body">>, Body}, {<<"form">>, to_json_terms(ParsedForm)}, {<<"cookie">>, to_json_terms(Req:parse_cookie())}]}. |