Created
July 23, 2014 20:49
-
-
Save stuffmc/194753a33748e21dc761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// curl -X POST -H "Content-Type: body=application/json" -d '{"logs":["xyz"]}' https://example.com/v1/log | |
$cont = file_get_contents('php://input'); | |
echo "cont: $cont\n"; // Outputs cont: {"logs":["xyz"]} | |
$log = json_decode($cont); | |
echo "log: $log\n"; // Never outputed. Even not "log:" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@PofMagicfingers this was because he wanted to access the object as a string as he didn't know how to deal with objects in php. But agree that it's error level didn't help him to debug as the error went silently…