The underlying connection was closed
hojat-shafiee opened this issue · comments
I'm receiving this error after 100 Posts:
The underlying connection was closed : A connection that was expected to be kept alive was closed by the server.
How do I fix؟
I am also getting same error. It is running well from my test application. But gives error when i do it from my actual application.
How to fix it? Please help!
I think we need to add more details for WebClient.
webrequest.KeepAlive = true; webrequest.Method = "GET"; webrequest.ContentType = "text/html"; webrequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; //webrequest.Connection = "keep-alive"; webrequest.Host = "cat.sabresonicweb.com"; webrequest.Headers.Add("Accept-Language", "en-US,en;q=0.5"); webrequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:18.0) Gecko/20100101 Firefox/18.0";
https://stackoverflow.com/questions/16928588/the-underlying-connection-was-closed-the-connection-was-closed-unexpectedly
This library worked on WpEngine but SiteGround.