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
-
- Object
- ControlMessage
- HttpProxyRequest
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
nullfor connection-level messages (the envelopecfield).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
tfield).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
dfield), 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.