HttpsClient class final

A client for the HTTPS binding (bindings/https/0.2).

final client = HttpsClient(
  base: Uri.parse('https://maintainer.example'),
  serverVid: 'did:web:maintainer.example',
  myVid: 'did:web:org.example',
  token: 's3cret',
);
final response = await client.send<acl_grant.Payload, acl_grant.Response>(
  request,
  encode: (p) => p.toJson(),
  decodeResponse: acl_grant.Response.fromJson,
);

Constructors

HttpsClient({required Uri base, String? serverVid, String? myVid, String? token, ProofVerifier? responseVerifier, Duration timeout = defaultClientTimeout, Client? httpClient})
base is the Trust-Task base (§6.1): the request goes to <base>/trust-tasks, with a trailing / on base ignored.

Properties

endpoint → Uri
Where requests are posted.
final
hashCode → int
The hash code for this object.
no setterinherited
myVid → String?
This client's VID. Stamped as issuer on a request that has none, and required as the recipient of every success response.
final
responseVerifier → ProofVerifier?
When set, every success response must carry a proof that verifies.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverVid → String?
The server's VID. Stamped as recipient on a request that has none, and required as the issuer of every success response.
final
timeout → Duration
Budget for one exchange.
final
token → String?
The bearer token (§3).
final

Methods

close() → void
Close the underlying HTTP client, if this client created it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send<P, R>(TrustTaskDocument<P> request, {required Object? encode(P payload), required R decodeResponse(Map<String, dynamic> json)}) → Future<TrustTaskDocument<R>>
Send request and return the #response document.
sendAck<P>(TrustTaskDocument<P> request, {required Object? encode(P payload)}) → Future<void>
Send request to a fire-and-forget specification (SPEC §4.4.1), whose consumer answers success with 204 No Content.
toString() → String
A string representation of this object.
inherited

Operators

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