If create the request from a Uri, you can have some control over this.  Try
this:

Uri uri = new Uri(uriString,true);
HttpWebRequest req = WebRequest.Create(uri);

The bool in the Uri constructor tells it to not escape the string.  The
Uri.UserEscaped property tells you if it has been escaped or not.

Jim

> -----Original Message-----
> From: Erick Thompson [mailto:[EMAIL PROTECTED]]
> Sent: 29 April 2002 19:44
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] Character escapes and HttpWebResponse
>
>
> Does anyone know the rules for how the HttpWebResponse
> handles the path and
> query escapes in URIs? If I request a page with the following format:
>
> http://www.somewhere.com/page.asp?#section
>
> the HttpWebResponse.ResponseUri.AbsoluteUri is
>
> http://www.somewhere.com/page.asp?%29section
>
> It looks like the # has been escaped. Is this the correct
> behaviour for this
> Uri? It doesn't seem like it to me. What rules does the
> HttpWebResponse
> object follow, as regards to when to escape characters and
> when not to.
>
> Thanks,
> Erick
>
> You can read messages from the DOTNET archive, unsubscribe
> from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to