Photo by israel palacio on Unsplash
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
Add these 2 lines just before the service is called. (.NET 4.8)
// using System.Net;
ServicePointManager.Expect100Continue = false;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
For more information :