OkHttp3 – unexpected end of stream on okhttp3.Address

I have a HttpClient that sends JSON object to my server. The problem is I am getting a exception error. How can I fix and avoid this in the future?

unexpected end of stream on okhttp3.Address@19e3287a

 string apifile = "login-api.php";

 var link = "http://" + ipaddress + ":" + Constants.port + "/" + Constants.apifolder + "/api/" + apifile;
  tring contentType = "application/json";
 JObject json = new JObject
 {
     { "Host", hostName },
     { "Database", database },
     { "userName", userName },
     { "Password", password },
     { "RegistrationCode", Constants.deviceID }
 };

 HttpClient client = new HttpClient();
 var response = await client.PostAsync(link, new StringContent(json.ToString(), Encoding.UTF8, contentType));

OkHttp3 – unexpected end of stream on okhttp3.Address