1
爲什麼添加DelegatingHandler
後無法添加驗證細節?向httpclient添加處理程序後無法添加構造函數
之前加入DelegatingHandler
,我能夠實例化HttpClient
像這樣:
var client = new HttpClient{Credentials = ..., BaseAddress = ...};
已經增加了DelegatingHandler
後,我無法添加Credentials
和BaseAddress
:
var client = new HttpClient(new RetryHandler(new HttpClientHandler()));
client.BaseAddress = // does not exist!
client.Credentials = // does not exist!
我們如何向這個客戶端添加憑證和基礎地址?