Class AndroidA2AHttpClient
java.lang.Object
org.a2aproject.sdk.client.http.android.AndroidA2AHttpClient
- All Implemented Interfaces:
A2AHttpClient
Android-specific implementation of
A2AHttpClient using HttpURLConnection.
Security Note: This client does not follow HTTP redirects automatically
to prevent credential leakage to third-party origins. Explicitly enabled GET and POST redirects
are followed once only when the target has the same origin. HttpURLConnection cannot
isolate process-wide CookieHandler or Authenticator state for one request, so
cross-origin redirects are deliberately not followed even when
A2AHttpClient.GetBuilder.followRedirects(boolean) or
A2AHttpClient.PostBuilder.followRedirects(boolean) is enabled.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.a2aproject.sdk.client.http.A2AHttpClient
A2AHttpClient.Builder<T extends A2AHttpClient.Builder<T>>, A2AHttpClient.DeleteBuilder, A2AHttpClient.GetBuilder, A2AHttpClient.PostBuilder -
Field Summary
Fields inherited from interface org.a2aproject.sdk.client.http.A2AHttpClient
ACCEPT, APPLICATION_JSON, CONTENT_TYPE, EVENT_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionAndroidA2AHttpClient(SSEParserConfig sseParserConfig) Creates a new Android HTTP client with custom SSE parser limits.AndroidA2AHttpClient(SSEParserConfig sseParserConfig, RedirectHeaderPolicy redirectHeaderPolicy) Creates a new Android HTTP client with custom parser limits and redirect policy. -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder for DELETE requests.Creates a builder for GET requests.Creates a builder for POST requests.static AndroidA2AHttpClientwithRedirectHeaderPolicy(RedirectHeaderPolicy redirectHeaderPolicy) Creates a new Android HTTP client with a custom redirect header policy.
-
Constructor Details
-
AndroidA2AHttpClient
public AndroidA2AHttpClient() -
AndroidA2AHttpClient
Creates a new Android HTTP client with custom SSE parser limits.- Parameters:
sseParserConfig- the SSE parser configuration to use for streaming responses
-
AndroidA2AHttpClient
public AndroidA2AHttpClient(SSEParserConfig sseParserConfig, RedirectHeaderPolicy redirectHeaderPolicy) Creates a new Android HTTP client with custom parser limits and redirect policy.- Parameters:
sseParserConfig- the SSE parser configuration to use for streaming responsesredirectHeaderPolicy- policy applied to explicitly enabled POST redirects
-
-
Method Details
-
withRedirectHeaderPolicy
public static AndroidA2AHttpClient withRedirectHeaderPolicy(RedirectHeaderPolicy redirectHeaderPolicy) Creates a new Android HTTP client with a custom redirect header policy.- Parameters:
redirectHeaderPolicy- policy applied to explicitly enabled POST redirects- Returns:
- a client with default SSE parser limits and the supplied redirect policy
-
createGet
Description copied from interface:A2AHttpClientCreates a builder for GET requests.- Specified by:
createGetin interfaceA2AHttpClient- Returns:
- a new GetBuilder instance
-
createPost
Description copied from interface:A2AHttpClientCreates a builder for POST requests.- Specified by:
createPostin interfaceA2AHttpClient- Returns:
- a new PostBuilder instance
-
createDelete
Description copied from interface:A2AHttpClientCreates a builder for DELETE requests.- Specified by:
createDeletein interfaceA2AHttpClient- Returns:
- a new DeleteBuilder instance
-