setHttpAuthCredential method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(apiName: 'URLCredentialStorage.set', apiUrl: 'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set'), MacOSPlatform(apiName: 'URLCredentialStorage.set', apiUrl: 'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set'), LinuxPlatform(note: 'Implemented using libsecret for secure storage.')])
Future<void> setHttpAuthCredential({
  1. required URLProtectionSpace protectionSpace,
  2. required URLCredential credential,
})

Saves an HTTP auth credential for that protectionSpace.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • protectionSpace: all platforms
  • credential: all platforms

Use the PlatformHttpAuthCredentialDatabase.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(),
    IOSPlatform(
      apiName: 'URLCredentialStorage.set',
      apiUrl:
          'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set',
    ),
    MacOSPlatform(
      apiName: 'URLCredentialStorage.set',
      apiUrl:
          'https://developer.apple.com/documentation/foundation/urlcredentialstorage/1407227-set',
    ),
    LinuxPlatform(note: 'Implemented using libsecret for secure storage.'),
  ],
)
Future<void> setHttpAuthCredential({
  required URLProtectionSpace protectionSpace,
  required URLCredential credential,
}) {
  throw UnimplementedError(
    'setHttpAuthCredential is not implemented on the current platform',
  );
}