public static HttpResponse executeGetRequest(String serviceEndPoint,boolean secure) throws IOException {
  URL url=(secure) ? new URL(SERVICE_ROOT_URI + "secure/" + serviceEndPoint) : new URL(SERVICE_ROOT_URI + serviceEndPoint);
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  if (secure) {
    connection.setRequestProperty("Authorization",AUTHORIZATION);
  }
  try {
    return new HttpResponse(connection);
  }
  finally {
    connection.disconnect();
  }
}

public static HttpResponse executeGetRequest ( String serviceEndPoint , boolean secure ) throws IOException { URL url = ( secure ) ? new URL ( SERVICE_ROOT_URI + "secure/" + serviceEndPoint ) : new URL ( SERVICE_ROOT_URI + serviceEndPoint ) ; HttpURLConnection connection = ( HttpURLConnection ) url . openConnection ( ) ; if ( secure ) { connection . setRequestProperty ( "Authorization" , AUTHORIZATION ) ; } try { return new HttpResponse ( connection ) ; } finally { connection . disconnect ( ) ; } }
run a http get request
