Java HttpURLConnection getErrorStream() MethodThe getErrorStream() is the method of HttpURLConnection class. This method is used to get an error stream if the connection is disconnected. This method does not set the connection. If the connection is not established or server does not cause any error during establishing the connection, then this method will return null. Null is the default value in this method. SyntaxReturnsThis method returns an error stream if any, else it returns default if no error occurs. Example 1Test it NowOutput: Error Stream : null Connection disconnected Example 2Test it NowOutput: Connection Established Error Stream : null Header field 1:0 Connection disconnected Next TopicJava HttpURLConnection class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India