public String getMetadata() throws ClientException {HttpRequest request = new HttpRequest(credentialUrl.toString());request.setSysMethod(MethodType.GET);request.setSysConnectTimeout(connectionTimeoutInMilliseconds);request.setSysReadTimeout(connectionTimeoutInMilliseconds);HttpResponse response;try {response = CompatibleUrlConnClient.compatibleGetResponse(request);} catch (Exception e) {throw new ClientException("Failed to connect ECS Metadata Service: " + e.toString());}if (response.getStatus() != HttpURLConnection.HTTP_OK) {throw new ClientException(ECS_METADAT_FETCH_ERROR_MSG + " HttpCode=" + response.getStatus());}return new String(response.getHttpContent());}
public string GetMetadata(){var request = new HttpRequest(credentialUrl);request.Method = MethodType.GET;request.SetConnectTimeoutInMilliSeconds(connectionTimeoutInMilliseconds);HttpResponse response;try{response = GetResponse(request);}catch (WebException e){throw new ClientException("Failed to connect ECS Metadata Service: " + e);}if (response.Status != 200){throw new ClientException(ECS_METADAT_FETCH_ERROR_MSG + " HttpCode=" + response.Status);}return Encoding.UTF8.GetString(response.Content);}