Table of Contents

Class HttpResponse

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

A wrapper class for the http response.

public record HttpResponse : IEquatable<HttpResponse>
Inheritance
HttpResponse
Implements
Inherited Members

Properties

Body

The raw HTTP response body, in JSON format.

[JsonPropertyName("body")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Body { get; set; }

Property Value

string

Headers

Used to retain the processed HTTP headers in the response.

[JsonPropertyName("headers")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string>? Headers { get; set; }

Property Value

Dictionary<string, string>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a HttpResponse object.

public static HttpResponse? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

HttpResponse

The deserialized HttpResponse object, or null if deserialization fails.