I recently encountered a 404 error when attempting to fetch one of my RSS feeds from FeedBurner. I have a web application that requests the feed using an HttpWebRequest in .NET and then formats it and displays it on the page. I could navigate to the feed just fine, but my web application stated that the connection could not be established because the server returned a 404-Not Found error. This was working all the while, so something had to have changed somewhere (and it wasn't in the code since the code hasn't changed in a month according to source control). Stepping through the code, I discovered that the URL that it was claiming it couldn't find was http://feedproxy.feedburner.com/.... The URL I was originally requesting was http://feeds.feedburner.com/..., so FeedBurner was redirecting my request for some reason. Using Live HTTP Headers in Firefox, I could see that my browser was not receiving this redirect.
Turns out that when I make the HttpWebRequest, if I supplied a UserAgent, then I didn't get redirected to that feedproxy.feedburner.com address. I've been meaning to go back in and supply a UserAgent anyway. I'm not sure what the feedproxy.feedburner.com URL does or why it went down, but supplying a UserAgent seems to avoid the redirect.
2 comments:
Thank you very much for this post.
Thanks for posting this. It helped me track down some trouble I was having with the RssToolkit. I posted my fix on my blog: http://weblogs.asp.net/jstengel/archive/2008/07/24/useragent-fix-for-the-rsstoolkit-2-0-0-0.aspx
Post a Comment