J
Jonathan Wood
I'm using XmlDocument.Load to retrieve a PAD (XML) file. My code looks
something like this:
XmlDocument xml = new XmlDocument();
// Non-HTTP prefix not supported
if (!url.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
throw new Exception("PAD URL contains an unsupported protocol
prefix");
// Load XmlDocument
xml.Load(url);
When url is set to "http://www.mobiletutor.org/guitar/jar.xml", I get the
following error:
The remote server returned an error: (400) Bad Request.
I notified this site about the error and here is their response:
"FYI, this is failing because your file fetcher is not sending HTTP
Accept headers and is thus considered insecure by our Web server. You
may want to fix that..."
I don't fully understand this response but, sure enough, if I load the URL
above using Internet Explorer, it appears to work just fine.
Does XmlDocument have some protocol problems, or is there something I can do
to make my code work in this case?
Thanks for any tips.
something like this:
XmlDocument xml = new XmlDocument();
// Non-HTTP prefix not supported
if (!url.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
throw new Exception("PAD URL contains an unsupported protocol
prefix");
// Load XmlDocument
xml.Load(url);
When url is set to "http://www.mobiletutor.org/guitar/jar.xml", I get the
following error:
The remote server returned an error: (400) Bad Request.
I notified this site about the error and here is their response:
"FYI, this is failing because your file fetcher is not sending HTTP
Accept headers and is thus considered insecure by our Web server. You
may want to fix that..."
I don't fully understand this response but, sure enough, if I load the URL
above using Internet Explorer, it appears to work just fine.
Does XmlDocument have some protocol problems, or is there something I can do
to make my code work in this case?
Thanks for any tips.