I have two IF in my php api that checks if request method is POST or DELTE . For Post method I get the variables in "Data" part of ajax using $_POST. But for DELETE Method I can't do.I've used the code below
$deleteAcKey = file_get_contents("php://input");
$test = array();
parse_str($deleteAcKey, $test);
echo json_encode($test);
However I get Some unreadable data. I want some json Data that i would access it in Ajax By using result.message
Any Suggestion? Any Other way to use?