0

I am attempting to create a web request as following:

var request = (HttpWebRequest)WebRequest.Create("http://localhost/test/data./?format=json");

But I keep getting exception where the underlying issue is with remote server returning a 404 (Not found). I narrowed down the issue to the dot after data. If I remove it, everything works. However, dot is part of the link and cannot be omitted. How can I fix this?

EDIT:

Solutions from Dots in URL causes 404 with ASP.NET mvc and IIS DO NOT work for me. I've tried slashes and config settings.

Please keep in mind that dots DO WORK inside the link but not at the end.

Community
  • 1
  • 1
eYe
  • 1,695
  • 2
  • 29
  • 54
  • This problem has nothing to do with you being unable to "create" a `HttpWebRequest`. This is a problem with the web-application you're using. The 404 response seems correct. What is the significance of the dot character, exactly? What do you mean by "part of the link and cannot be omitted"? – Dai Oct 22 '15 at 18:32
  • 'data' is coming from a user, it is a searched item, so I do not want restricting that. Inputs without the trailing dot work, I've tested. – eYe Oct 22 '15 at 18:33

0 Answers0