xml - C# HttpWebRequest shows 404, but site is reachable in browser -
i trying download xml file website c#, 404 on urls. wired because still work in browser. other urls still work without problem.
httpwebrequest request = (httpwebrequest) webrequest.create(url); request.method = "get"; request.timeout = 3000; request.useragent = "test client"; httpwebresponse response = null; try { response = (httpwebresponse) request.getresponse(); } catch (webexception e) { response = (httpwebresponse)e.response; } console.writeline("- "+response.statuscode); xmltextreader reader = xmltextreader(response.getresponsestream());
this url 1 of said problem urls:
http://numerique.bibliotheque.toulouse.fr/cgi-bin/oaiserver?verb=listmetadataformats
solved....forgot trim url ;)
i can speculate host site might not useragent
, returning 404 message
Comments
Post a Comment