withBasicCredentials method

HttpWaitStrategy withBasicCredentials(
  1. String username,
  2. String password
)

Sets HTTP Basic authentication credentials.

The credentials are base64-encoded as username:password and added as an Authorization: Basic <encoded> header.

Returns this for chaining.

Implementation

HttpWaitStrategy withBasicCredentials(String username, String password) {
  final encoded = base64.encode(utf8.encode('$username:$password'));
  _headers['Authorization'] = 'Basic $encoded';
  return this;
}