Created
July 26, 2017 19:58
-
-
Save Zvax/49e0de93ae25a8dbfc6e23b5b69c928c to your computer and use it in GitHub Desktop.
reading data from request body
This file contains 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
$inputStream = fopen("php://input", "r"); | |
$contents = ''; | |
while (!feof($inputStream)) { | |
$contents .= fread($inputStream, 8192); | |
} | |
fclose($inputStream); | |
$dataFromRequest = json_decode($contents, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment