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

MinimalHttpAsyncClient does not allow null HttpContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.0
    • 5.0.1
    • HttpClient (async)
    • None

    Description

      In HttpAsyncClient.execute, the Javadoc says:

      @param context HTTP context. Optional and may be {@code null}.

      However, the following code will cause a NullPointerException because the input HttpContext is null:

        public static void main(String[] args) throws Exception {
          try (MinimalHttpAsyncClient client = HttpAsyncClients.createMinimal()) {
            client.start();
            client.execute(SimpleRequestProducer.create(SimpleHttpRequests.get("https://example.com")),
                SimpleResponseConsumer.create(), null, null, null).get();
          }
        }

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            slisaasquatch Siqi Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: