HttpClient starts throwing exceptions after a few requests to a specific server. After some tests I noticed that it always stops working at request number 33. The server sends this response header:
Keep-Alive:timeout=5, max=32
I have tried to dispose HttpClient at request number 32 or less but it does not solve the problem.
How should I handle it in order to send requests without problems to this server ?
尝试调用HttpClient.Dispose
或显式设置Connection: close
标头
client.DefaultHeaders.Add("Connection", "close");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.