On Mar 7, 2009, at 7:05 PM, Chris Anderson wrote:

On Sat, Mar 7, 2009 at 12:49 AM, Wout Mertens <[email protected]> wrote:
Hi all,

I noticed the following discrepancy: When you try to request a design
document, and you encode the / as %2F, couchdb will redirect you to a URL
with %2f decoded to /, which works.


_show/wiki/showpage/section/subsection/page

The problem becomes distinguishing between documents and attachments.


Docids are always urlencoded, with the exception of _design/ docids,
which can be requested with the / unencoded (the redirect was put
there to make that rule self-documenting.)

Well IMHO that punishes libraries that try to do good things for the user, now they have to special-case _design/ to avoid a network round- trip. I'd be happier if both ways just worked.

Slashes in attachment names can also be used unencoded, so

/db/wiki/showpage/section/subsection/page address the attachment named
"showpage/section/subsection/page" on the document with id "wiki"

Right. So in summary, the rule is either of these:

1. http://server/dbname/document/path/in/attachment
2. http://server/dbname/_special/document

where document is always url-encoded? If so I'll update the wiki.
(API_Cheatsheet and HTTP_Document_API)

This was discussed intensively on this thread:
http://www.mail-archive.com/[email protected]/msg00018.html

I should have found that, sorry, I didn't think of search first :(

Wout.

Reply via email to