Code example for BasicHttpEntityEnclosingRequest

0
 
  private JSONObject getStatus() throws Exception {
    HttpClient client = HttpClientFactory.getClient();
    String url = model.getEndPoint() + "/status";
    URL u = new URL(url);
    BasicHttpEntityEnclosingRequest r = new BasicHttpEntityEnclosingRequest("GET", url);
 
    HttpHost h = new HttpHost(u.getHost(), u.getPort());
    HttpResponse response = client.execute(h, r);
 
    JSONObject o = Helper.extractObject(response);
 
    return o;
  } 
 
 
 
  private JSONObject getAppFromStatus() throws Exception {
    JSONObject status = getStatus();
    JSONArray array = status.getJSONObject("value").getJSONArray("supportedApps");
    for (int i = 0; i < array.length(); i++) {