Reputation: 907
This is my code for for reading file from URL.
URL url = new URL(urlString);
reader = new BufferedReader(new InputStreamReader(url.openStream()));
But the problem is-
java.io.IOException: Server returned HTTP response code: 502 for
URL: http://dbpedia.org/data/Germany.json
This error does not occur every-time. can anybody help me?
Upvotes: 0
Views: 7526
Reputation: 2991
If you try to access this link in the browser:
And according to List of HTTP status codes code 502 is:
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
So that's the answer. :-)
in the console
Upvotes: 1