Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 29554 invoked from network); 11 Feb 2009 12:04:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 12:04:43 -0000 Received: (qmail 96615 invoked by uid 500); 11 Feb 2009 12:04:37 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 96578 invoked by uid 500); 11 Feb 2009 12:04:37 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 96567 invoked by uid 99); 11 Feb 2009 12:04:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 04:04:37 -0800 X-ASF-Spam-Status: No, hits=3.6 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_NEUTRAL,URIBL_RHS_DOB,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 12:04:29 +0000 Received: from dahlia.lan (f053000042.adsl.alicedsl.de [::ffff:78.53.0.42]) (AUTH: LOGIN jan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Wed, 11 Feb 2009 12:04:06 +0000 Message-Id: From: Jan Lehnardt To: user@couchdb.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [user] Re: badarg in browser? Date: Wed, 11 Feb 2009 13:03:33 +0100 References: <545E6E13-5C80-4A4B-8107-EB667DC698B7@cisco.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org 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 --