Code example for URL

Methods: getHost, getPort

0
  public JSONObject getStatus() {
 
    try { 
      HttpClient client = HttpClientFactory.getClient();
      String url = 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;
    } catch (Exception e) {
      throw new WebDriverException(e.getMessage(), e);
    } 
 
  } 
 
}