Get post information in drupal function
Assuming that you're using Drupal 7, take a look at the module Content as JSON. This should take care of the details and put you within the realm of the "drupal-way". There's also the Services module which might be overkill for what you're doing.

If you stick with file_get_contents then don't forget json_decode:

$received = file_get_contents("drupal://input"); // Use inputstream module.
$received = json_decode($received, TRUE);


Then you can play around as much as you'd like with the $received value.

Additionally, the inputstream module is invaluable in letting you get to the input stream more than once (if you try using php://input more than once, the second time, and those following, will return NULL).