Code example for URL

Methods: getHostgetPort

  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);
Connect your IDE to all the code out there  Get Codota for Java