PrepareHttpWebRequest method
Initializes a new instance of the
The version of EWS that the service targets.
The time zone to which the service is scoped.
Initializes a new instance of the
The version (new style) of EWS that the service targets.
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(ExchangeVersion requestedServerVersion, TimeZoneInfo timeZone)
// : super(requestedServerVersion, timeZone)
// {
// }
/// <summary>
/// Initializes a new instance of the <see cref="ExchangeService"/> class, targeting
/// the specified version of EWS and scoped to the system's current time zone.
/// </summary>
/// <param name="targetServerVersion">The version (new style) of EWS that the service targets.</param>
/// <remarks>
/// The target version string has a required part and an optional part.
/// The required part is two integers separated by a dot, major.minor
/// The optional part is a minimum required version, minimum=major.minor
/// Examples:
/// X-EWS-TargetVersion: 2.4
/// X-EWS_TargetVersion: 2.9; minimum=2.4
/// </remarks>
// ExchangeService(string targetServerVersion)
// : super(ExchangeVersion.Exchange2013)
// {
// ExchangeService.ValidateTargetVersion(targetServerVersion);
// this.TargetServerVersion = targetServerVersion;
// }
/// <summary>
/// Initializes a new instance of the <see cref="ExchangeService"/> class, targeting
/// the specified version of EWS and scoped to the specified time zone.
/// </summary>
/// <param name="targetServerVersion">The version (new style) of EWS that the service targets.</param>
/// <param name="timeZone">The time zone to which the service is scoped.</param>
/// <remarks>
/// The new style version string has a required part and an optional part.
/// The required part is two integers separated by a dot, major.minor
/// The optional part is a minimum required version, minimum=major.minor
/// Examples:
/// 2.4
/// 2.9; minimum=2.4
/// </remarks>
// 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 = this.Url!;
// todo("fix RegisterCustomBasicAuthModule")
// print(".. fix RegisterCustomBasicAuthModule");
// this.RegisterCustomBasicAuthModule();
//
// endpoint = this.AdjustServiceUriFromCredentials(endpoint);
IEwsHttpWebRequest request = await this
.PrepareHttpWebRequestForUrl(endpoint, this.AcceptGzipEncoding, true);
if (!StringUtils.IsNullOrEmpty(this.TargetServerVersion)) {
request.Headers.Set(ExchangeService.TargetServerVersionHeaderName,
this.TargetServerVersion);
}
return request;
}