HttpProxyRequest class final

Client → Hub: make an outbound HTTPS request to an AI provider on the client's behalf (the browser cannot, due to CORS). The Hub validates the target against an allowlist, optionally injects credentials, and replies with an HttpProxyResponse. Correlated by requestId.

Inheritance

Constructors

HttpProxyRequest({required String requestId, required String method, required String url, required Map<String, String> headers, required String body, HttpProxyCredentialMode credentialMode = HttpProxyCredentialMode.none, String? provider})
Creates an HTTP-proxy request.
const

Properties

body String
The request body (UTF-8 text; AI APIs use JSON).
final
channelId int?
The channel this message pertains to, or null for connection-level messages (the envelope c field).
no setterinherited
credentialMode HttpProxyCredentialMode
Whether the Hub should inject default credentials.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The request headers.
final
method String
The HTTP method (typically POST).
final
provider String?
The provider token, used to pick the credential scheme when credentialMode is hubDefault.
final
requestId String
The correlation id echoed in the response.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The stable type discriminator (the envelope t field).
no setteroverride
url String
The absolute request URL (must be https and on the Hub's allowlist).
final

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) HttpProxyRequest
Decodes an HttpProxyRequest.

Constants

typeName → const String
The type discriminator.