clearCustomHeaders method

Future<void> clearCustomHeaders()

Removes all custom headers previously configured via setCustomHeaders or setCustomHeadersForHost.

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

Implementation

Future<void> clearCustomHeaders() async {
  try {
    await _channel.invokeMethod('map#clearCustomHeaders');
  } on MissingPluginException catch (e) {
    throw PlatformException(
      code: 'MISSING_IMPLEMENTATION',
      message:
          'Native implementation for clearCustomHeaders is not available',
      details: e.toString(),
    );
  } catch (e) {
    throw PlatformException(
      code: 'CLEAR_HEADERS_FAILED',
      message: 'Failed to clear custom headers',
      details: e.toString(),
    );
  }
}