Class RestHandler.HTTPRestResponse
java.lang.Object
org.a2aproject.sdk.transport.rest.handler.RestHandler.HTTPRestResponse
- Direct Known Subclasses:
RestHandler.HTTPRestStreamingResponse
- Enclosing class:
- RestHandler
Represents an HTTP REST response with status code, content type, and body.
-
Constructor Summary
ConstructorsConstructorDescriptionHTTPRestResponse(int statusCode, String contentType, String body) Creates an HTTP REST response.Creates an HTTP REST response with custom headers. -
Method Summary
-
Constructor Details
-
HTTPRestResponse
Creates an HTTP REST response.- Parameters:
statusCode- the HTTP status codecontentType- the content type of the responsebody- 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 codecontentType- the content type of the responsebody- the response bodyheaders- additional HTTP headers
-
-
Method Details
-
getStatusCode
public int getStatusCode()Returns the HTTP status code.- Returns:
- the status code
-
getContentType
Returns the content type.- Returns:
- the content type
-
getBody
Returns the response body.- Returns:
- the body
-
getHeaders
Returns additional HTTP headers.- Returns:
- the headers map
-
toString
-