Interface A2AHttpResponse


public interface A2AHttpResponse
HTTP response wrapper containing status code and response body.

Provides access to the HTTP status code, a success indicator, and the response body content.

Usage Example


 A2AHttpResponse response = client.createGet()
     .url("http://localhost:9999/api/endpoint")
     .get();

 if (response.success()) {
     String body = response.body();
     // Process successful response
 } else {
     int status = response.status();
     // Handle error based on status code
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the response body content as a string.
    Returns the HTTP response headers.
    int
    Returns the HTTP status code.
    boolean
    Indicates whether the request was successful.
  • Method Details

    • status

      int status()
      Returns the HTTP status code.
      Returns:
      the HTTP status code (e.g., 200, 404, 500)
    • success

      boolean success()
      Indicates whether the request was successful.

      Typically returns true for 2xx status codes.

      Returns:
      true if the request was successful, false otherwise
    • body

      String body()
      Returns the response body content as a string.
      Returns:
      the response body, may be empty but not null
    • headers

      default A2AHttpHeaders headers()
      Returns the HTTP response headers.

      Provides access to response headers such as Retry-After, WWW-Authenticate, or any other server-provided headers.

      Returns:
      the response headers, never null; may be empty