Java HttpURLConnection getResponseMessageThe getResponseMessage is a method of Java HttpURLConnection class. This method is used to get response code from HTTP response message. For example, if the response code from a server is HTTP/1.0 200 OK or HTTP/1.0 404 Not Found, it extracts the string OK and Not Found else returns null if HTTP is not valid. SyntaxReturnsIt returns response message of HTTP or null ThrowIOException - It throws this exception if an error occurs while connecting the server. Example 1Test it NowOutput: https://www.javatpoint.com Connection Response Message : 200 Example 2Test it NowOutput: https://www.facebook.com Connection Response Message : OK 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