Class HttpResponse

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.HttpResponse

public abstract class HttpResponse extends JsonSerializable
A wrapper class for the http response.
  • Constructor Details

    • HttpResponse

      public HttpResponse()
  • Method Details

    • headers

      public abstract Optional<Map<String,String>> headers()
      Used to retain the processed HTTP headers in the response.
    • body

      public abstract Optional<String> body()
      The raw HTTP response body, in JSON format.
    • builder

      public static HttpResponse.Builder builder()
      Instantiates a builder for HttpResponse.
    • toBuilder

      public abstract HttpResponse.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static HttpResponse fromJson(String jsonString)
      Deserializes a JSON string to a HttpResponse object.