Hi Jens,

This is the command, really. Actually, I discovered that if I put quotes around 
the URL I don't need to escape the offending character(s) works fine:

TurboMonkey:_design tito$ curl 
"http://127.0.0.1:5984/test/_design/test/_view/test-byTown?startkey=%5B%22foo%20ca%22%5D&endkey=%5B%22foo%20ca%22,%7B%7D%5D";
{"total_rows":2,"offset":0,"rows":[
{"id":"9b857ca67a2611d51595aa3ad0306f30","key":["foo 
ca","9b857ca67a2611d51595aa3ad0306f30"],"value":null}
]}

Thank you,

-- Tito

On Feb 13, 2014, at 8:34 AM, Jens Alfke <[email protected]> wrote:

> 
> On Feb 13, 2014, at 8:24 AM, Tito Ciuro <[email protected]> wrote:
> 
>> This works as expected. However, if I issue the same command with curl I get 
>> more than I expected:
>> 
>> curl 
>> http://127.0.0.1:5984/test/_design/test/_view/test-byTown?startkey=%5B%22foo%20ca%22%5D&endkey=%5B%22foo%20ca%22,%7B%7D%5D
> 
> I don't think that's the exact command line you used, because without quotes 
> the shell's going to interpret the '?' character as a wildcard. Could you 
> post the exact command line?
> 
> (Also, could you show what the startkey and endkey expand to? I'm not good at 
> doing URL-unescaping in my head.)
> 
> —Jens
> 
> PS: I've found that the 'httpie' tool saves a lot of sanity when sending 
> command-line requests to CouchDB. It's similar to curl but a lot friendlier, 
> and makes it very easy to add custom queries and JSON body properties without 
> doing a ton of quoting.

Reply via email to