I hope someone can help me, since 2 days I have problems to send a JSON string to my php File.
In my web extension I have a json that must be sent to my php file:
var request = new XMLHttpRequest;
request.open("POST", "http://www.xxx.de/Add.php", true);
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
request.addEventListener('load', function (event) {
if (request.status >= 200 && request.status < 300) {
}
console.log("Sent status: " + request.status);
});
request.send(JSON.stringify(item));
with a console log I see that my item is not empty and the request.status is 200.
In my Add.php file I have
$data = file_get_contents('php://input');
$data is empty when I look at it. 3 days ago everything was running fine...
What could be wrong?