couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taras Puchko <taras.puc...@gmail.com>
Subject Re: database names containing +
Date Tue, 07 Sep 2010 19:17:24 GMT
Hi,

It looks like CouchDB has the same requirement for document ids. This
might pose a problem with clients that build URLs dynamically.

I've tried RESTEasy:
System.out.println(UriBuilder.fromPath("http://localhost/mydb").segment("a/b+c").build().toString());

It prints:
http://localhost/mydb/a%2Fb+c


Another problem I've found is that CouchDB doesn't allow matrix
parameters in a segment so _view/myview;p1=v1;p2=v2/myId doesn't work.


I personally have found [1] invaluable when trying to understand URL encoding.

[1] http://www.lunatech-research.com/archives/2009/02/03/what-every-web-developer-must-know-about-url-encoding

Cheers,
Taras

On Tue, Sep 7, 2010 at 8:29 PM, Samuel <samuelrivas@gmail.com> wrote:
> I always get lost when trying to re-interpret the URI RFC, but I
> understood that it is reserved for queries, and in my case it is in a
> path:
>
>  Within a path segment, the characters
>     "/", ";", "=", and "?" are reserved.
>
> According to this, the only reserved character allowed for DB names is
> / that certainly should be encoded.
>
> It's not a big deal, I just wanted to avoid as much URL processing as
> possible and found strange that + required encoding and, for example
> $, didn't
>
> Cheers
> On 7 September 2010 18:52, Noah Slater <nslater@apache.org> wrote:
>>
>> On 7 Sep 2010, at 17:27, Samuel wrote:
>>
>>> Is the + symbol special for some reason? Any other character seem to
>>> work without encoding?
>>
>> It is a reserved URI character, so it needs to be encoded as a literal value.
>>
>
>
>
> --
> Samuel
>

Mime
View raw message