HttpProxyResponse class final

Hub → Client: the result of a proxied AI request. On a transport-level failure (rejected host, timeout, DNS) error is set and statusCode is 0. Correlated by requestId.

Inheritance

Constructors

HttpProxyResponse({required String requestId, required int statusCode, Map<String, String> headers = const {}, String body = '', String? error})
Creates an HTTP-proxy response.
const

Properties

body String
The response body (UTF-8 text).
final
channelId int?
The channel this message pertains to, or null for connection-level messages (the envelope c field).
no setterinherited
error String?
A transport/validation error message, or null on an HTTP round-trip (even a non-2xx one — the provider's body is then returned as-is).
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The response headers.
final
requestId String
The correlation id from the request.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code, or 0 when error is set.
final
type String
The stable type discriminator (the envelope t field).
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
The message payload (the envelope d field), without the type or channel.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJson(int? channel, Map<String, dynamic> d) HttpProxyResponse
Decodes an HttpProxyResponse.

Constants

typeName → const String
The type discriminator.