1

I can load a request in browser but not in my program

I am trying to use contentanalysis.analyze tool in a java program with the URL:

http://query.yahooapis.com/v1/public/yql?q=select * from contentanalysis.analyze where text="Brother held over Alps family murder A 54-year-old man is arrested in Surrey in connection with the murders of four people in the French Alps, including his brother."

(Just a recent BBC News Article title and description combined)

When I load this in my java program I get an error:

Connection Error
java.io.IOException: Server returned HTTP response code: 505 for URL: <http://query.yahooapis.com/v1/public/yql?q=select> * from contentanalysis.analyze where text="Brother held over Alps family murder A 54-year-old man is arrested in Surrey in connection with the murders of four people in the French Alps, including his brother."
    at sun.net.<http://www.protocol.http.HttpURLConnection.getInputStream>(Unknown Source)
    at java.net.URL.openStream(Unknown Source)
    at XMLReader.<init>(XMLReader.<java:24>)
    at Article.loadAPITags(Article.<java:213>)

Which to me means "The XML result did not load". Is there a reason why i can load it in browser but doing a simple:

URL u = new URL(url);
BufferedReader reader = new BufferedReader(new InputStreamReader(u.openStream())); 

causes an IOException error?

by
  • Ed
  • Jun 24, 2013
2 Replies

Recent Posts

in YQL