Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1064

ExecutionContext returning HttpUriRequest with invalid URI (missing host)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 4.1 Final
    • None
    • HttpClient (classic)
    • Windows 7, java 1.6.0.21

    Description

      The HttpUriRequest contains an invalid URI - host is null

      public static void main(String args[]) throws ClientProtocolException, IOException
      {
      HttpParams httpParams = new BasicHttpParams();
      HttpClient httpclient = new DefaultHttpClient(httpParams);
      HttpGet httpGet = new HttpGet("http://www.google.com/");
      HttpContext context = new BasicHttpContext();
      httpclient.execute(httpGet, context);
      HttpUriRequest currentReq = (HttpUriRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
      System.out.println("New URI host (why is it null?): " + currentReq.getURI().getHost());
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            troccola Ted Troccola
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: