0
我送的下方EWS的請求,交換請求的默認用戶代理頭:重寫
var service = new ExchangeService(exchangeVersion)
{
KeepAlive = true,
Url = new Uri("some autodiscovery url"),
Credentials = new NetworkCredential(username, password),
UserAgent = "myClient"
};
var subscription = service.SubscribeToPushNotifications(
new[] { inboxFolderFoldeID },
new Uri("some post back url"),
15,
null,
EventType.NewMail,
EventType.Created,
EventType.Deleted,
EventType.Modified,
EventType.Moved,
EventType.Copied);
但是,這將導致到具有User-Agent頭爲myClient (ExchangeServicesClient/15.00.0913.015)
一個請求,其中的其餘部分該字符串來自使用此默認值的EWS庫。有沒有辦法刪除標題的默認部分,並將其作爲myClient
?
編輯:我可以看到EWS庫似乎只是前綴在請求中傳遞的值:https://github.com/OfficeDev/ews-managed-api/blob/master/Core/ExchangeServiceBase.cs
是的,似乎是實現這一目標的唯一方法。 – tavier