File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
src/Senparc.CO2NET/Utilities/HttpUtility/HttpGet Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,8 @@ public static async Task<string> DownloadAsync(
328328 System . Net . Http . HttpClient httpClient = serviceProvider . GetRequiredService < SenparcHttpClient > ( ) . Client ;
329329#endif
330330 //httpClient.Timeout = TimeSpan.FromMilliseconds(timeOut); // 此处建议不要直接修改httpClient的Timeout属性,因为这是该Client的全局共享值,会影响同Client实例下的其他请求超时时间
331+ // 微软技术文档原文链接【https://docs.microsoft.com/zh-cn/dotnet/api/system.net.http.httpclient.timeout?f1url=%3FappId%3DDev16IDEF1%26l%3DZH-CN%26k%3Dk(System.Net.Http.HttpClient.Timeout);k(DevLang-csharp)%26rd%3Dtrue&view=net-6.0】
332+ // 文档提到“使用此实例的所有请求都将使用相同的超时值 HttpClient 。 你还可以使用任务上的为单个请求设置不同的超时 CancellationTokenSource 。”
331333 using ( var cts = new System . Threading . CancellationTokenSource ( timeOut ) )
332334 {
333335 try
You can’t perform that action at this time.
0 commit comments