AlphaXAppClient class final
A small application-facing layer over AlphaXClient.
The facade resolves relative string targets against one validated HTTP(S)
base URL, converts simple maps to AlphaX headers, and turns supplied data
into an AlphaXBody.json body. It delegates request execution, middleware,
policies, streaming, and response semantics to the wrapped client.
baseUrl must be an absolute HTTP(S) URL without a fragment or URL
user-information component. It resolves relative targets as a directory;
absolute targets bypass it. The base URL is not an authentication boundary:
configured middleware still sees every resolved request, so use only
trusted absolute targets with a credentialed client.
Use AlphaXAppClient.owned when this facade is responsible for the underlying client, or AlphaXAppClient.borrowed when another owner must keep it alive. A facade does not create a transport or a global singleton.
Constructors
- AlphaXAppClient.borrowed(AlphaXClient client, {required String baseUrl, Duration? timeout})
-
Creates a facade that borrows
clientwithout closing it. - AlphaXAppClient.owned(AlphaXClient client, {required String baseUrl, Duration? timeout})
-
Creates a facade that closes
clientwhen close is called.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> - Closes this facade exactly once.
-
delete(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Object? data = _alphaXDataNotSupplied, AlphaXBody? body, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a DELETE request to
path. -
get(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a GET request to
path. -
head(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a HEAD request to
path. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Object? data = _alphaXDataNotSupplied, AlphaXBody? body, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a PATCH request to
path. -
post(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Object? data = _alphaXDataNotSupplied, AlphaXBody? body, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a POST request to
path. -
put(
String path, {Map< String, Object?> ? queryParameters, Map<String, String> ? headers, Object? data = _alphaXDataNotSupplied, AlphaXBody? body, Duration? timeout, AlphaXCancellationToken? cancellationToken}) → Future<AlphaXResponse> -
Sends a PUT request to
path. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited