title: HttpURLConnection: Difference between getResponseMessage(), getInputStream() and getContent()
body: <p>Team,</p>
  
  <p>I have come across the code like below,</p>
  
  <pre><code>private static String getResponse (HttpURLConnection connection) throws Exception
  {
     String responseString = null;
     int responseCode = connection.getResponseCode();
     String responseMessage = connection.getResponseMessage();
     Log.debug("%s - Response code is \"%s\" with message \"%s\"",
            methodName, responseCode, responseMessage);
     String line = null;
     if (responseCode == HttpURLConnection.HTTP_OK) {
         BufferedReader bufferedReader = null;
         try {
             InputStream inputStream = connection.getInputStream();
             if (inputStream != null) {
                 bufferedReader = Util.bufferedReader(
                     inputStream, Util.Encod.UTF8);
                 StringBuilder response = new StringBuilder();
                 while ((line = bufferedReader.readLine()) != null) {
                     response.append(line);
                     response.append(Util.getNewLine());
                 }
                 responseString = response.toString();
             }
         }
         finally {
             if (bufferedReader != null) {
                 bufferedReader.close();
             }
         }
         Log.signature.debug(
             "%s - Received following JSON response : %s",
             methodName,
             responseString);
     }
     return responseString;
  } 
  </code></pre>
  
  <p>Here they have already received the response like below right?</p>
  
  <pre><code>String responseMessage = connection.getResponseMessage()
  </code></pre>
  
  <p>Then why they are again using <code>connection.getInputStream()</code></p>
  
  <p>Is there any difference?</p>
  
  <p>If possible could you please also explain some example OR when to use the below than the above <code>getResponseMessage() / getInputStream()</code></p>
  
  <pre><code>Class URLConnection 
     public Object getContent() throws IOException 
     public Object getContent(Class[] classes) throws IOException
  </code></pre>