I actually already tried to double-escape the url and it didn't work.

For some reason, .Net doesn't unescape the %25 character.  So if you post to a 
url like http://localhost:5984/somedatabase/_design%252Fmyview, it will 
actually post to that exact url and you end up with a document in your database 
with an id of "_design%2Fmyview".

-----Original Message-----
From: Alex Chapman [mailto:[EMAIL PROTECTED]
Sent: Friday, November 07, 2008 11:28 PM
To: couchdb-user@incubator.apache.org
Subject: Re: Creating views using PUT

In my case it turned out that the problem was also my http library
unencoding the '/' before sending the request.

Maybe as a workaround for .Net you could try double-escaping the character
like so: "_design%252fmyview". If you unencode that once, you get
"_design%2fmyview".

2008/11/8 John Bartak <[EMAIL PROTECTED]>

> This is a follow up to the message from Nov 1 entitled "Creating views
> using PUT".
>
> In a manner similar to the original poster, I'm trying to create a view
> using an HTTP POST request.  I try to post to
> http://localhost:5984/somedatabase/_design/myview, but instead of creating
> a document with an id of "_design/myview", it creates a document with an id
> of "_design", with an attachment called "myview".  The original thread
> discussed encoding "/" between _design and myview as "%2F".
>
> Unfortunately, this technique doesn't work from .Net.  The .Net Uri object
> (and therefore the HttpWebRequest object) automatically unescapes the URI.
>  There doesn't appear to be any way to change this behavior.
>
> When we were running CouchDB version 0.9.0a698039 we didn't have to escape
> the slash character.  The latest version (0.9.0a712213) requires this
> escaping.
>
>

Reply via email to