我正在尝试使用 HttpClientHandler 设置anglesharp.io 的超时值。
这个问题表明它是可能的:https ://github.com/AngleSharp/AngleSharp/issues/266
我得到这样的页面:
NetworkCredential proxyCreds = new NetworkCredential(proxy.User, proxy.Pass);
WebProxy wProxy = new WebProxy(proxy.Ip + ":" + proxy.Port, false)
{
UseDefaultCredentials = false,
Credentials = proxyCreds,
};
HttpClientHandler httpClientHandler = new HttpClientHandler()
{
Proxy = wProxy,
PreAuthenticate = true,
UseDefaultCredentials = false
};
var config = Configuration.Default.WithRequesters(httpClientHandler);
var document = await BrowsingContext.New(config).OpenAsync(address);
我看不到任何可用于设置超时的属性。如何设置超时?