Code example for HttpURLConnection

Methods: getResponseMessage

0
    public int getStatusCode() throws IOException { 
        return connection.getResponseCode();
    } 
 
    public String getReasonPhrase() throws Exception {
        return connection.getResponseMessage();
    } 
 
    public Object unwrap() {
        return connection;
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java