今天在調用一個網站時發現,在執行一個請求時,一直提示超時,單步操作沒問題,放到線程里就一直超時,
需要加上System.Net.ServicePointManager.DefaultConnectionLimit = 512;//默認值好像是2,所以跑不起來
2021-8-25
還可以加上下面這部分代碼
request.ServicePoint.Expect100Continue = false;
request.Timeout = Timeout.Infinite;
request.KeepAlive = true;