When you specify a Content-Type of application/x-www-form-urlencoded, the XMLHttpRequest API is expecting that your post data be formatted just like query parameters. i.e.: ip=val1&ua=val2&country=val3. The following code should post to your script by first encoding the FormData entries into a URLSearchParams instance, then exporting that to a string.
var data = new FormData();
data.append('ip', 'val');
data.append('ua', 'val2');
data.append('country', 'val3');
var xhr = new XMLHttpRequest();
xhr.open('POST', 'visitor.php?type=visitorControl', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
var params = new URLSearchParams(data);
xhr.send(params.toString());