Could anyone tell me why the following statement does not send the post data to the designated url? The url is called but on the server when I print $_POST - I get an empty
I don't have the reputation to comment, but in response/addition to Don F's answer:
$params = json_decode(file_get_contents('php://input'));
A second parameter of true
needs to be added to the json_decode
function in order to properly return an associative array:
$params = json_decode(file_get_contents('php://input'), true);