I know that this is not the proper way to write code, but I still like to understand this behavior - whenever I do an async HTTP request without waiting for the result, it seems like the request is terminated? (I do not see it on fiddler).
Code sample:
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost.fiddlerhttpclient/");
var response = client.GetAsync("zzzz");
}
}
}
}
If I change the code to:
var response = client.GetAsync("zzzz").Result;
I do see it on fiddler. I don't understand why - I would expect that the request would still keep processing in background somehow, so why doesn't it?