basicAuthorization static method

HTTPHeader basicAuthorization(
  1. String username,
  2. String password
)

Implementation

static HTTPHeader basicAuthorization(String username, String password) {
  final credential = '$username:$password';
  final bytes = utf8.encode(credential);
  final base64String = base64.encode(bytes);
  return HTTPHeader.authorization(base64String);
}