tags:

views:

37

answers:

2

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

A: 
echo '<pre>',print_r($_POST),'</pre>';
Grumpy
A: 

Raw:

echo file_get_contents('php://input');

Possibly more easily parseble:

echo json_encode($_POST);
echo serialize($_POST);

For debugging purposes:

var_dump($_POST);
Wrikken