PrepareHttpWebRequest method
Initializes a new instance of the
The version (new style) of EWS that the service targets.
The time zone to which the service is scoped.
Creates an HttpWebRequest instance and initializes it with the appropriate parameters,
based on the configuration of this service object.
Name of the method.
Implementation
// ExchangeService(string targetServerVersion, TimeZoneInfo timeZone)
// : super(ExchangeVersion.Exchange2013, timeZone)
// {
// ExchangeService.ValidateTargetVersion(targetServerVersion);
// this.TargetServerVersion = targetServerVersion;
// }
/// <summary>
/// Creates an HttpWebRequest instance and initializes it with the appropriate parameters,
/// based on the configuration of this service object.
/// </summary>
/// <param name="methodName">Name of the method.</param>
/// <returns>
/// An initialized instance of HttpWebRequest.
/// </returns>
Future<IEwsHttpWebRequest> PrepareHttpWebRequest(String methodName) async {
Uri endpoint = Url!;
// todo("fix RegisterCustomBasicAuthModule")
// print(".. fix RegisterCustomBasicAuthModule");
// this.RegisterCustomBasicAuthModule();
//
// endpoint = this.AdjustServiceUriFromCredentials(endpoint);
IEwsHttpWebRequest request = await PrepareHttpWebRequestForUrl(
endpoint,
AcceptGzipEncoding,
true,
);
if (!StringUtils.IsNullOrEmpty(TargetServerVersion)) {
request.Headers.Set(
ExchangeService.TargetServerVersionHeaderName,
TargetServerVersion,
);
}
return request;
}