Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java read from connection even if 404

HttpURLConnection c = (HttpURLConnection)new URL("http://somesite.com").openConnection();
InputStream in = null;
if (c.getResponseCode() >= 400) {
   in = c.getErrorStream();
}  
else {
   in = c.getInputStream();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #read #connection
ADD COMMENT
Topic
Name
1+5 =