Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 90531 invoked from network); 18 May 2009 20:37:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 May 2009 20:37:32 -0000 Received: (qmail 84419 invoked by uid 500); 18 May 2009 20:37:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 84355 invoked by uid 500); 18 May 2009 20:37:31 -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 84345 invoked by uid 99); 18 May 2009 20:37:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 20:37:31 +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.173] (HELO outmail129173.authsmtp.com) (62.13.129.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 20:37:21 +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 n4IKaxl9031100 for ; Mon, 18 May 2009 21:36:59 +0100 (BST) Received: from [192.168.1.182] (host79-238-dynamic.54-82-r.retail.telecomitalia.it [82.54.238.79]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n4IKav2K053847 for ; Mon, 18 May 2009 21:36:58 +0100 (BST) Message-ID: <4A11C6A7.9030806@griffinbyteworks.com> Date: Mon, 18 May 2009 22:35:51 +0200 From: Kai Griffin User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: URL encoding issue References: <4A0FC837.9040009@griffinbyteworks.com> <20090518114607.GA3309@uk.tiscali.com> <4A11B9C9.1080001@griffinbyteworks.com> <2767FC6C-943B-4C3D-96BF-DDBEE9F029B6@detailedbalance.net> In-Reply-To: <2767FC6C-943B-4C3D-96BF-DDBEE9F029B6@detailedbalance.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Server-Quench: a251a985-43eb-11de-aecc-001871e930f4 X-AuthRoute: OCdxZQsVBFZWRQUy BTkFAiFBTw80OhBT BgUANk1RJ18fSB9c KG5RKUdYMFEWA1hB UjVTDkoLEgo/WGtq FlsYcgddYkNeXQRg U05DR1ocHAd2BBgf BB0WTB57aAdDZ34+ O0IbJSEdXj96cEV1 RkkaF2gDYSkxamUe AUlQch5Qc1YYYx5E PgViBSZeMngHZnto QFY+bmtpM2lJEikH Cjw3CRofR00MEj86 SFgDBi4yECVf 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 On 18/05/2009 21:54, Rhett Sutphin wrote: > Hi Kai, > > On May 18, 2009, at 2:40 PM, Kai Griffin wrote: > >> Hi Brian, >> >> I've been escaping the square brackets and double quotes in curl, >> like this \[\" ....\" \] - which seems to work. I'll start using >> -g in curl so I don't have to escape the square braces. >> >> Wrapping the url in single quotes results in the single quote being >> interpreted as part of the url itself, and curl complains that >> "protocol 'http is not supported". >> >> As for %22's... I cannot make that work at all. If I encode double >> quotes as %22's in curl, couchdb complains about invalid JSON, and it >> looks as if all the %'s have been stripped out and the 22's become >> part of the request. For example the following request: >> >> (snip) > > You are on windows, right? In the regular windows shell, environment > variable substitution is done with %ENV_VAR_NAME% (roughly equivalent > to $ENV_VAR_NAME in bash). So %22SYD%22 would mean "take the value of > the 22SYD environment variable and concatenate 22". If there is no > such env var, the result would just be "22". This fits with the > invalid JSON couchdb is seeing. > > Long story short, I think you need to escape the '%'s from the windows > shell. I don't know how to do this, but I'm sure it is possible. Aha! Thank-you, Rhett - this never crossed my mind, though it makes perfect sense. It's a simple matter of doubling the % (%%) to ensure the command processor doesn't try to do the replacement. When I just tried this, my curl command worked fine, and as Brian suggested, I get a successful result whether I escape the quotes with backslashes or encoded them as %22's. Now I just need to figure out why the HTTPService from Flex is not working... clearly the url-encoding has nothing to do with it and I've no doubt got an unrelated bug in my own work. Best regards, Kai > > Rhett >