requireAuthentication method

void requireAuthentication({
  1. bool require = true,
  2. String type = 'Basic',
  3. String realm = 'API',
})

Defines that this response requires authentication.

Depending of the serve implementation (usually HTTP), it will send to the client the request for authentication (in HTTP is the headers WWW-Authenticate).

Implementation

void requireAuthentication(
    {bool require = true, String type = 'Basic', String realm = 'API'}) {
  _requiresAuthentication = require;
  _authenticationType = type;
  _authenticationRealm = realm;
}