Using the below Ajax call in my local machine.
$.ajax({
    type: "POST",
    data: {
        id : '1234',
        name : 'test',
    },
    url: "https://testdomain.com/test.php",
    success: function (response) {
        console.log(response);
        } else {
            console.log('error);
        }
    }
});
But getting cors error
access to XMLHttpRequest at 'https://testdomain.com/test.php' from origin 'http://localhost/' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains the invalid value.
 
     
    