开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜