On Feb 11, 2009, at 12:46 PM, Jan Lehnardt wrote:
On 11 Feb 2009, at 00:22, Wout Mertens wrote:
I'm trying to run the couchdb svn head and I'm not able to create
documents or run the test suite using Futon. I tried both Safari
and Firefox. Troubleshooting further I tried curl:
$ curl -X PUT -d '{"keys": ["param1", "param2", "paramN"]}'
http://localhost:5984/test/foo
{"error":"error","reason":"badarg"}
What Paul said or use POST without `_id`.
You also need `-H "Content-Type: application/json"` at least.
Ok now I tried
$ curl -X POST -H "Content-Type: application/json" -d '{"keys":
["param1", "param2", "paramN"]}' http://localhost:5984/test/foo
{"error":"badmatch","reason":"{\"application/json\",[]}"}
Which gives this at debug level:
[error] [<0.57.0>] Uncaught error in HTTP request: {error,{badmatch,
{"application/json",[]}}}
[debug] [<0.57.0>] Stacktrace: [{mochiweb_multipart,get_boundary,1},
{mochiweb_multipart,parse_multipart_request,2},
{mochiweb_multipart,parse_form,2},
{couch_httpd_db,db_doc_req,3},
{couch_httpd_db,do_db_req,2},
{couch_httpd,handle_request,3},
{mochiweb_http,headers,4},
{proc_lib,init_p,5}]
[debug] [<0.57.0>] HTTPd 500 error response:
{"error":"badmatch","reason":"{\"application/json\",[]}"}
[info] [<0.57.0>] 127.0.0.1 - - 'POST' /test/foo 500
I'm running Erlang 5.6.0
Try 5.6.5.
I'll try that now.
And fresh checkouts of CouchDB trunk as well.
They are :-( and going back doesn't change things either.
Wout.