Class JdkA2AHttpClient

java.lang.Object
org.a2aproject.sdk.client.http.JdkA2AHttpClient
All Implemented Interfaces:
A2AHttpClient

public class JdkA2AHttpClient extends Object implements A2AHttpClient
Default HTTP client implementation using JDK 11+ HttpClient.

This is the fallback implementation used when no higher-priority A2AHttpClientProvider is available. It provides full support for:

  • HTTP/2 with automatic fallback to HTTP/1.1
  • Synchronous GET, POST, and DELETE requests
  • Asynchronous Server-Sent Events (SSE) streaming
  • Automatic redirect following

Provider Priority: 0 (lowest - used as fallback)

This implementation is registered via JdkA2AHttpClientProvider in the ServiceLoader system and is automatically used by A2AHttpClientFactory when no other provider is available.

See Also:
  • Constructor Details

    • JdkA2AHttpClient

      public JdkA2AHttpClient()
      Creates a new JDK-based HTTP client.

      Configures the client with:

      • HTTP/2 preferred (with HTTP/1.1 fallback)
      • Normal redirect following
    • JdkA2AHttpClient

      public JdkA2AHttpClient(HttpClient httpClient)
      Creates a new JDK-based HTTP client using a caller-provided JDK HttpClient.
      Parameters:
      httpClient - the JDK HTTP client to delegate requests to
      Throws:
      IllegalArgumentException - if httpClient is null
  • Method Details