I wish to load the web page from BBC rss feed with the HttpGet function in my android app. When I get the link from rss feed, and I use
HttpGet request = new HttpGet(link);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try{
String response_str = client.execute(request, responseHandler);
textView.setText(response_str);
}
For the RSS feed from NY times, I can get the context in their webpage, which means this function at least work for some situation. However, in the BBC new’s cases, I only get a webpage like
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http:///www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns= "http:///www.w3.org/1999/xhtml"
xmlns:og="http://opengraphprotocal.org/schema." xml:lang="en-GB">
I am wondering are there any redirect situation I needs to handle or something? Otherwise it will be strange if this code works for some webpage while not work for others.
Thanks for your reading.
Not sure what URL you are using, but the following code works for me:
Verify that you are using a valid feed URL (partial list can currently be viewed here).