How do you get the JSON body in PHP?

$_POST doesn’t always get you what you need. If you are passing in JSON as the body of a request, you can’t get it using $_POST. You will have to use file_get_contents('php://input');. I found this to be extremely annoying and not well documented.