java read from connection even if 404

Solutions on MaxInterview for java read from connection even if 404 by the best coders in the world

showing results for - "java read from connection even if 404"
Ahmed
10 Sep 2019
1HttpURLConnection c = (HttpURLConnection)new URL("http://somesite.com").openConnection();
2InputStream in = null;
3if (c.getResponseCode() >= 400) {
4   in = c.getErrorStream();
5}  
6else {
7   in = c.getInputStream();
8}
similar questions
queries leading to this page
java read from connection even if 404