fireRequestEvent(RequestEvent.REQUEST_CREATED, ret);
  public Request newRequest(String method, String path)  {    if (method == null || method.length() == 0)      {        throw new IllegalArgumentException("method must have non-zero length");      }    if (path == null || path.length() == 0)      {        path = "/";      }    Request ret = new Request(this, method, path);    if ((secure && port != HTTPS_PORT) ||        (!secure && port != HTTP_PORT))      {        ret.setHeader("Host", hostname + ":" + port);      }    else      {    ret.setHeader("Host", hostname);      }    ret.setHeader("User-Agent", userAgent);    ret.setHeader("Connection", "keep-alive");    ret.setHeader("Accept-Encoding",                  "chunked;q=1.0, gzip;q=0.9, deflate;q=0.8, " +                  "identity;q=0.6, *;q=0");    if (cookieManager != null)      {        Cookie[] cookies = cookieManager.getCookies(hostname, secure, path);        if (cookies != null && cookies.length > 0)          {            StringBuffer buf = new StringBuffer();            buf.append("$Version=1");            for (int i = 0; i < cookies.length; i++)              {                buf.append(',');                buf.append(' ');                buf.append(cookies[i].toString());              }            ret.setHeader("Cookie", buf.toString());          }      }    fireRequestEvent(RequestEvent.REQUEST_CREATED, ret);    return ret;  }