code: protected Response readResponse(HttpURLConnection connection) throws IOException {
          // Try to get the input stream and if that fails, try to get the error stream.
          InputStream in;
          try {
              in = connection.getInputStream();
          } catch (IOException e) {
              in = connection.getErrorStream();
          }
  
          // If either stream is present, try to read the response body.
          String body = "";
          if (in != null) {
              try {
                  body = KeenUtils.convertStreamToString(in);
              } finally {
                  KeenUtils.closeQuietly(in);
              }
          }
  
          // Build and return the HTTP response object.
          return new Response(connection.getResponseCode(), body);
      }
docs: Reads a {@link Response} from an existing connection. This method should only be
  called on a connection for which the entire request has been sent.
  
  @param connection The connection that sent the response.
  @return The {@link Response}
  @throws IOException If there is an error reading the response from the connection.