【发布时间】:2019-01-24 10:06:54
【问题描述】:
我正在使用 .net 461、Microsoft.AspNet.WebApi 5.2.3
var testServer = Microsoft.Owin.Testing.TestServer.Create<MyConfig>();
//this has no effect, and Timeout is still the default 100 seconds
testServer.HttpClient.Timeout = TimeSpan.FromSeconds(200);
如果我这样做,那么设置就会生效:
var client = new HttpClient
{
BaseAddress = new Uri("baseaddress")
};
client.Timeout = TimeSpan.FromSeconds(200); // this change has effect
为什么我不能在第一个 sn-p 上更改 TimeOut 属性?
【问题讨论】:
标签: c# asp.net-web-api httpclient