我有一些代码如下:
using (var client = new HttpClient())
{
client.Timeout = TimeSpan.FromMilliseconds(3000);
var request = new HttpRequestMessage(HttpMethod.Head, myURI);
var response = await client.SendAsync(request);
}
但是当我进入调试器时,代码只是挂起等待client.SendAsync(...)。它不会抛出任何异常,并且控件不会继续。它无限期地挂起。有谁知道我错了什么?