All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dart2.auth.http_basic_auth.mustache Maven / Gradle / Ivy

There is a newer version: 7.6.0
Show newest version
{{>header}}
{{>part_of}}
class HttpBasicAuth implements Authentication {
  HttpBasicAuth({this.username = '', this.password = ''});

  String username;
  String password;

  @override
  Future applyToParams(List queryParams, Map headerParams,) async {
    if (username.isNotEmpty && password.isNotEmpty) {
      final credentials = '$username:$password';
      headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy