php script to echo a post
Could someone help with a simple PHP script to echo the whole message received with an HTTPPOST.
I am sending a string from an android app using HTTPPOST and would like to receive 开发者_运维问答as a response the message received by the POST at the server.
The script that I am using will only echo name value pairs
echo $_POST('data')
works when I post form data, but have not figured out how to echo a string.
Thanks
echo '<pre>',print_r($_POST),'</pre>';
Raw:
echo file_get_contents('php://input');
Possibly more easily parseble:
echo json_encode($_POST);
echo serialize($_POST);
For debugging purposes:
var_dump($_POST);
精彩评论