setCustomHeadersForHost method

Future<void> setCustomHeadersForHost(
  1. String host,
  2. Map<String, String> headers
)

Sets custom HTTP headers scoped to a specific host.

The headers are attached only to requests whose URL host matches host exactly (case-insensitive); there is no subdomain or substring matching.

host is the target host, for example "tiles.example.com". headers is a map of header names to header values. Passing an empty map removes any headers previously configured for host.

Calls for different hosts accumulate; calling again for the same host replaces that host's headers. This is a process-global setting that applies to all map instances.

Throws a PlatformException if the native implementation is not available or if the operation fails.

Implementation

Future<void> setCustomHeadersForHost(
  String host,
  Map<String, String> headers,
) async => _impl.setCustomHeadersForHost(host, headers);