3

Possible Duplicate:
HttpWebRequest to URL with dot at the end

I am facing a weird problem. When I am trying to get a page using HttpWebRequest page is not coming properly. The url has a dot into it like http://www.xyz.com/abc./do . You can see this url has a dot into it. So when I am trying fetching that data using HttpWebRequest data is not coming properly. So I tracked it with fiddler and I saw this class omitting the dot like http://www.xyz.com/abc/do . How can I solve this problem ?

NB. This is not a real url. But the problem is real.

12
  • as I can see you are missing forward slash it should be http:// Commented Jul 8, 2011 at 15:33
  • Sorry another type mistake. I have modified it. Commented Jul 8, 2011 at 15:37
  • Yeah sure. automatica-munich.com/exvi/en/bfa_solutions_ltd./CH/A1/328 Commented Jul 8, 2011 at 15:38
  • I've tried to open it in my browser and it doesn't work... Commented Jul 8, 2011 at 15:38
  • 2
    Interesting - I can't find any other problems like this - nor cna I find a way (so far) to prevent the address being parsed and the "." being removed. You can't escape the character obviously, and even if you try Uri x = new Uri("automatica-munich.com/exvi/en/bfa_solutions_ltd./CH/A1/…); you'll see the same behaviour. I still think the URL provided is badly formatted, but no idea how to handle it... Commented Jul 8, 2011 at 16:01

1 Answer 1

1

may be encoding url solve the problem

HttpUtility.UrlEncodeUnicode(url)
Sign up to request clarification or add additional context in comments.

1 Comment

. is a valid url character, and therefore won't be encoded by the method call above.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.