code: private static String getIdentityDocument(final HttpClient client) throws IOException {
      try {
        final HttpGet getInstance = new HttpGet();
        getInstance.setURI(INSTANCE_IDENTITY_URI);
        final HttpResponse response = client.execute(getInstance);
        if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
          throw new IOException("failed to get instance identity, tried: " + INSTANCE_IDENTITY_URL + ", response: " + response.getStatusLine().getReasonPhrase());
        }
        return EntityUtils.toString(response.getEntity());
      } catch (Exception e) {
        throw new IOException("failed to get instance identity", e);
      }
    }
docs: Gets the body of the content returned from a GET request to uri.
  
  @param client
  @return the body of the message returned from the GET request.
  @throws IOException if there is an error encountered while getting the content.