Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 61919 invoked from network); 17 May 2009 08:19:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 May 2009 08:19:32 -0000 Received: (qmail 65868 invoked by uid 500); 17 May 2009 08:19:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 65779 invoked by uid 500); 17 May 2009 08:19:30 -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 65769 invoked by uid 99); 17 May 2009 08:19:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 May 2009 08:19:30 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.13.129.174] (HELO outmail129174.authsmtp.net) (62.13.129.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 May 2009 08:19:20 +0000 Received: from mail-c188.authsmtp.com (mail-c188.authsmtp.com [62.13.128.25]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4H8IwmM009794 for ; Sun, 17 May 2009 09:18:58 +0100 (BST) Received: from [192.168.1.182] (host167-236-dynamic.54-82-r.retail.telecomitalia.it [82.54.236.167]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4H8IuN9008852 for ; Sun, 17 May 2009 09:18:57 +0100 (BST) Message-ID: <4A0FC837.9040009@griffinbyteworks.com> Date: Sun, 17 May 2009 10:17:59 +0200 From: Kai Griffin - Relaxing Reply-To: user@couchdb.apache.org User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: URL encoding issue Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Server-Quench: 5e5029fd-42bb-11de-aecc-001871e930f4 X-AuthRoute: OCdxZQsVBFZWRQUy BTkFAiFBTw80OhBT BgUANk1RJ18fSB9c KG5RKUdYMFEWA1hB UjVTDkoLEgo/WGRq FlsYcgddYkNeXwxg UUBDR1UcHAd2BBgf BB0YTBh0cBpEfWFw KxhmJngiGTpzdUZ1 SktWW2wOZmEubTUa UEJRIVdJdAEYLAJE awQqSSJYMjYaZnph T1BqMmFqZTsDPhlv ZkkAK1kVTUcNEXY9 XAsfEF1z X-Authentic-SMTP: 61633235333037.cat.dmpriest.net.uk:1562/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Checked: Checked by ClamAV on apache.org Hi, These past few weeks, I've been re-building our flagship product as a Flex application, with couchdb as the back end, and this has been progressing really well. However, I've hit a strange snag, to do with URL encoding. Flex's HTTPService component automatically url-encodes requests, so that... ....?startkey=["SYD","LAX","2008-01-01T00:00:00Z"]&endkey=["SYD","LAX",2008-01-01T23:59:59Z"] becomes... ....?startkey=[%22SYD%22,%22LAX%22,%222008-01-01T00:00:00Z%22]&endkey=[%22SYD%22,%22LAX%22,....etc....] that is, when I look at the Erlang console after the request has been sent from Flex, I see the request with quotes encoded as %22's as shown above when issued from Flex. The trouble is, couchdb fails to return any rows when those quotes are encoded as %22's like that. When I issue the exact same request in curl, the quotes are not automatically encoded (they still show as quotes in Erlang's console), and I get the correct result set for the view. I always use group=true, so that's not the difference. What is particularly strange to me, is that a different design/view I have works perfectly with the following key: ....?startkey=[911,%222008-01-01T00:00:00Z%22]&...etc In this case, the first item in the key is an unquoted integer, but couchdb is still fine with the quoted date, and correctly returns a result from either Flex or curl. Any suggestions from a kind soul out there? Cheers, Kai