Client.withCredentials constructor

Client.withCredentials(String url, String username, String password)

Creates a client for the specified URL, using HTTP Basic authentication.

Implementation

Client.withCredentials(String url, String username, String password) {
  String auth = Base64Encoder().convert(Utf8Encoder().convert('${username}:${password}'));
  this._client = new http.Client();
  this._url = url;
  this._authentication = 'Basic ${auth}';
}