View Single Post
Old 10-05-2012, 03:14 PM   PM User | #2
loamguy1
Regular Coder

 
Join Date: Nov 2007
Posts: 106
Thanks: 13
Thanked 0 Times in 0 Posts
loamguy1 is an unknown quantity at this point
Eventually found the solution to this:

If you use JSON in a POST to a REST service, the JSON object is not treated as a valid query string. So, the POST array will exist, but it will be empty.

Here is the work-around:

$post_vars = file_get_contents('php://input');

// Second parm TRUE, decodes into associative array
$data = json_decode($post_vars, TRUE);
loamguy1 is offline   Reply With Quote