HttpWebRequest Url escaping

.net, c#

Solution

Kyle posted the answer in a comment, so to make it official: GETting a URL with an url-encoded slash

It's a weird work around, but nevertheless gets the job done.

Problem

I know, the title sounds like this question has been addressed many times. But I am struggling with a specific case and I am very confused over it. Hopefully a seasoned C#'er could point me in the correct direction. I have the code: ``` string serviceURL = "https://www.domain.com/service/tables/bucketname%2Ftables%2Ftesttable/imports"; HttpWebRequest dataRequest = (HttpWebRequest)WebRequest.Create(serviceURL); ``` Now when I quickwatch dataRequest, I see that: ``` RequestUri: {https://www.domain.com/service/tables/bucketname/tables/testtable/imports} ``` And it looks like the HttpWebRequest has changed both the `%2F` to `/`. However, the server needs the requested Uri to be exactly as serviceURL is written, containing the `%2F`. Is there any way to get the HttpWebRequest class to call the Url: ``` https://www.domain.com/service/tables/bucketname%2Ftables%2Ftesttable/imports ``` Many thanks! I am at a complete loss here... -Brett

Original source

Related problems