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.8.0
Show newest version
part of {{pubName}}.api;

class HttpBasicAuth implements Authentication {

  String _username;
  String _password;

  @override
  void applyToParams(List queryParams, Map headerParams) {
    String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password);
    headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str));
  }

  set username(String username) => _username = username;
  set password(String password) => _password = password;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy