PrepareWebRequest method

void PrepareWebRequest(
  1. IEwsHttpWebRequest request
)
override
This method is called to apply credentials to a service request before the request is made. The request.

Implementation

void PrepareWebRequest(IEwsHttpWebRequest request) {
  final secret = "$userName:$password";
  final encodedSecret = base64Encode(utf8.encode(secret));
  request.Headers.Add("Authorization", "Basic $encodedSecret");
}