I'm testing my new PHP REST web service via localhost (
http://localhost/myservice.php). It should accept both GET(retrieve info for one user) and POST requests(updates one user's preferences) via jQuery AJAX.
Testing the GET functionality in the service is working great. I'm passing in a JSON structure and passing another back.
However, I'm having trouble with the same service processing a POST request. It should accept JSON as the input. The code is correctly recognizing the request was a POST, not a GET, but the actual $_POST array is empty.
I tried two different REST clients to test my service - POSTMAN and cREST. Both apps give me the same empty POST array. For testing I'm just outputing the POST array in the REST service which shows:
Array
(
)
One interesting tidbit: For debugging, I displayed 'php://input' which showed the POST variables were passed, but the actual $_POST array is empty.
Has anyone had this problem before? I checked out several REST tutorials online, and haven't been able to find out any information on this issue.
Any ideas welcome of course...