interceptedClient function
InterceptedClient
interceptedClient({
- required List<
InterceptorContract> interceptors, - Map<
String, String> proxy = const {},
Creates an InterceptedClient configured with the given interceptors and optional proxy settings.
On Web platforms, proxy configurations are handled natively by the browser.
Example:
final client = interceptedClient(
interceptors: [
InterceptorHeader(requestHeader: {'Authorization': 'Bearer $token'}),
InterceptorLogger(logger, true),
],
);
Implementation
InterceptedClient interceptedClient({
required List<InterceptorContract> interceptors,
Map<String, String> proxy = const {},
}) {
return InterceptedClient.build(
interceptors: interceptors,
);
}