Class RestHandler.HTTPRestResponse

java.lang.Object
org.a2aproject.sdk.transport.rest.handler.RestHandler.HTTPRestResponse
Direct Known Subclasses:
RestHandler.HTTPRestStreamingResponse
Enclosing class:
RestHandler

public static class RestHandler.HTTPRestResponse extends Object
Represents an HTTP REST response with status code, content type, and body.
  • Constructor Details

    • HTTPRestResponse

      public HTTPRestResponse(int statusCode, String contentType, String body)
      Creates an HTTP REST response.
      Parameters:
      statusCode - the HTTP status code
      contentType - the content type of the response
      body - the response body
    • HTTPRestResponse

      public HTTPRestResponse(int statusCode, String contentType, String body, Map<String,String> headers)
      Creates an HTTP REST response with custom headers.
      Parameters:
      statusCode - the HTTP status code
      contentType - the content type of the response
      body - the response body
      headers - additional HTTP headers
  • Method Details

    • getStatusCode

      public int getStatusCode()
      Returns the HTTP status code.
      Returns:
      the status code
    • getContentType

      public String getContentType()
      Returns the content type.
      Returns:
      the content type
    • getBody

      public String getBody()
      Returns the response body.
      Returns:
      the body
    • getHeaders

      public Map<String,String> getHeaders()
      Returns additional HTTP headers.
      Returns:
      the headers map
    • toString

      public String toString()
      Overrides:
      toString in class Object