我正在使用 WebClient 向一个运行时间很长的 API 发出请求。但我实际上并不需要知道结果,我只需要启动过程。
这个过程是成功还是失败对我来说并不重要。所以我想在我提出请求后立即断开连接。
如何断开 webclient 的连接?我不想等待 30 - 60 秒的响应:
var client = new WebClient();
string url = "http://example.com/SomeVeryLongRunningProcess/parameter";
client.BeginDownloadString(uri);
client.DropConnection; // how do I drop the connection before the response is received?