0

I have the following code that loads a link into HttpWebRequest:

string actualLinkString = nextLink.First();
Uri actualLinkUri = new System.Uri(actualLinkString);
HttpWebRequest l_oRequest = (HttpWebRequest)WebRequest.Create(actualLinkUri);

The URL in question is

http://moodle.tau.ac.il/pluginfile.php/409194/mod_resource/content/2/0571.4118.01-E01-26-2-13_OptLink%20%20Project%20at%20We%20Say%20So%20Engineering%20Incpdf.

This is a valid URL, including the dot at the end

After the URI is loaded, this is the l_oRequest.AbsoluteURI field:

http://moodle.tau.ac.il/pluginfile.php/409194/mod_resource/content/2/0571.4118.01-E01-26-2-13_OptLink%20%20Project%20at%20We%20Say%20So%20Engineering%20Incpdf

Notice that the dot at the end has been omitted, meaning this URI returns a 404...

What could have caused this?

Nitay
  • 4,193
  • 6
  • 33
  • 42
  • 1
    [This will help you I think, similar issue](http://stackoverflow.com/questions/856885/httpwebrequest-to-url-with-dot-at-the-end) – Emmanuel Istace Aug 10 '13 at 22:31
  • [How can I disable this period-trimming behavior of the Uri class?](http://stackoverflow.com/questions/2515959/how-to-create-a-uri-instance-parsed-with-genericuriparseroptions-dontcompresspat) – Tim Schmelter Aug 10 '13 at 22:35
  • Thanks Emmanuel, I've set the flag as proposed in the link. Tim - See the link Emmanuel attached – Nitay Aug 11 '13 at 05:51

0 Answers0