2
craigslist에서 RDF 피드를 사용하려고하면 (401) Unauthorized WebException이 발생합니다. 두 개의 주석 처리 된 URL 바로 아래에 문제없이 읽을 수 있습니다. Internet Explorer를 사용하여 craigslist URL로 직접 이동할 수 있다면 XmlReader를 사용하여 데이터를로드 할 때 왜 실패합니까?XmlReader를 사용하면 Unauthorized WebException이 발생합니다.
http://portland.craigslist.org/search/sss?query=mac&srchType=A&format=rss
static void Main(string[] args)
{
XmlReader reader = XmlReader.Create("http://portland.craigslist.org/search/sss?query=mac&srchType=A&format=rss");
//XmlReader reader = XmlReader.Create("http://wdfw.wa.gov/news/newsrss.php");
//XmlReader reader = XmlReader.Create("http://rss.slashdot.org/Slashdot/slashdot");
Rss10FeedFormatter rf = new Rss10FeedFormatter();
rf.ReadFrom(reader);
Console.ReadLine();
}
}