Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
XMLHttpRequest gets The remote host closed the connection error on iOS

I'm struggling with a strange issue where, only on iOS Safari browsers, my XMLHttpRequest POST get the following error:

"The remote host closed the connection"

Here's the JS code that creates and sends the request:

var formData = new FormData();

formData.append('someField1', val1);
formData.append('someField2', val2);

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
    if (request.readyState == 4 && request.status == 200) {
        callback(request.responseText);
    }
}
request.open('POST', url);
request.send(formData);

and here's the server side code that attempts to read the form data, but all values for some reason are null - again - only on iOS Safari browsers.

string var1 = Request.Form["someField1"];
string var2 = Request.Form["someField2"];

I think it might have something to do with this posted bug, but I can't seem to fix the issue since I don't know which values to send in the header, spcifically how to add the Content-Type to the request's header and with which value.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!