couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: [user] Re: badarg in browser?
Date Wed, 11 Feb 2009 12:03:33 GMT

On 11 Feb 2009, at 12:55, Wout Mertens wrote:

> 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},

Seems like there's a multipart request going on? Can you add the -v  
option?

Here's my output:

jan@dahlia ~> curl -X PUT http://127.0.0.1:5984/test
{"ok":true}jan@dahlia ~>
jan@dahlia ~>
jan@dahlia ~>
jan@dahlia ~> curl -vX POST -H "Content-Type: application/json" -d  
'{"keys": ["param1", "param2", "paramN"]}' http://127.0.0.1:5984/test
* About to connect() to 127.0.0.1 port 5984 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
 > POST /test HTTP/1.1
 > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3  
OpenSSL/0.9.7l zlib/1.2.3
 > Host: 127.0.0.1:5984
 > Accept: */*
 > Content-Type: application/json
 > Content-Length: 40
 >
< HTTP/1.1 201 Created
< Server: CouchDB/0.9.0a737015-incubating (Erlang OTP/R12B)
< Date: Wed, 11 Feb 2009 12:02:31 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 70
< Cache-Control: must-revalidate
<
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0
{"ok 
":true 
,"id":"4a905d8c19d657344323ae5921da1f2f","rev":"2489901775"}jan@dahlia  
~>

Cheers
Jan
--


Mime
View raw message