Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 53228 invoked from network); 17 Mar 2010 00:45:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Mar 2010 00:45:42 -0000 Received: (qmail 4734 invoked by uid 500); 17 Mar 2010 00:45:41 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 4706 invoked by uid 500); 17 Mar 2010 00:45:41 -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 4698 invoked by uid 99); 17 Mar 2010 00:45:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 00:45:41 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=AWL,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [80.244.253.218] (HELO mail.traeumt.net) (80.244.253.218) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Mar 2010 00:45:33 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.traeumt.net (Postfix) with ESMTP id 5F6651B504 for ; Wed, 17 Mar 2010 01:45:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.g3th.net Received: from unknown by localhost (amavisd-new, unix socket) id IUsAy1AOB3Xq for ; Wed, 17 Mar 2010 01:45:11 +0100 (CET) Received: from [10.0.2.6] (rrcs-97-77-198-17.sw.biz.rr.com [97.77.198.17]) (authenticated) by mail.traeumt.net (amavisd-milter) (authenticated as web50m1); Wed, 17 Mar 2010 01:45:10 +0100 (CET) (envelope-from ) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: "invalid UTF-8 JSON" 400 error accessing view with 'key' parameter From: Jan Lehnardt In-Reply-To: <49ba0cc11003161733q7dcd1ee2wb828e09bb677b472@mail.gmail.com> Date: Tue, 16 Mar 2010 19:45:09 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <49ba0cc11003161733q7dcd1ee2wb828e09bb677b472@mail.gmail.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1077) Hi Erich, On 16 Mar 2010, at 19:33, erich oliphant wrote: > I am a new CouchDB user. =20 Welcome :) > I've populated my db with some documents and I've > begun delving into views. I have a simple view that seems to work = fine with > no params, like so: >=20 > curl -X GET = http://localhost:5984/testerp1/_design/onestop/_view/PONumbers > {"total_rows":104,"offset":0,"rows":[ > = {"id":"d15d7d12-af01-4137-b56e-2bb2fdea5721","key":"AAA-99036","value":"d1= 5d7d12-af01-4137-b56e-2bb2fdea5721"}, > = {"id":"3e1d30ba-759f-4bff-b6c7-64536d772b09","key":"AAA-99057","value":"3e= 1d30ba-759f-4bff-b6c7-64536d772b09"}, > ... > However trying to grab a single result, causes a 400 > curl -vX GET > http://localhost:5984/testerp1/_design/onestop/_view/PONumbers?key=3D > "AAA-99057" Your shell interprets the double quotes. Try this: curl -vX GET = 'http://localhost:5984/testerp1/_design/onestop/_view/PONumbers?key=3D"AAA= -99057"' Cheers Jan -- > * About to connect() to localhost port 5984 (#0) > * Trying ::1... Connection refused > * Trying fe80::1... Connection refused > * Trying 127.0.0.1... connected > * Connected to localhost (127.0.0.1) port 5984 (#0) >> GET /testerp1/_design/onestop/_view/PONumbers?key=3DAAA-99057 = HTTP/1.1 >> User-Agent: curl/7.20.0 (i386-apple-darwin10.2.0) libcurl/7.20.0 > OpenSSL/0.9.8m zlib/1.2.4 libidn/1.16 >> Host: localhost:5984 >> Accept: */* >>=20 > < HTTP/1.1 400 Bad Request > < Server: CouchDB/0.10.1 (Erlang OTP/R13B) > < Date: Wed, 17 Mar 2010 00:28:46 GMT > < Content-Type: text/plain;charset=3Dutf-8 > < Content-Length: 54 > < Cache-Control: must-revalidate > < > {"error":"bad_request","reason":"invalid UTF-8 JSON"} > * Connection #0 to host localhost left intact > * Closing connection #0 >=20 > I've tried the key param with and without quotes,etc but get the same > issue. All of the other issues I've seen online have been related to = PUT > bodies not being encoded correctly, but I've seen nothing similar to = my > case. >=20 > Thanks In Advance > --=20 > Erich Oliphant >=20 > "There are, in fact, two things, science and opinion, the former = begets > knowledge, the latter ignorance" > -- Hippocrates of Cos