How do I emulate an HTTP POST request using curl and capturing the result on a text file? I already have a script called dump.php:
<?php
$var = print_r($GLOBALS, true);
$fp = fopen('raw-post.txt','w');
fputs($fp,$var);
fclose($fp);
?>
I did a simple test by doing:
curl -d 'echo=hello' http://localhost/dump.php
but I didn't see the data I dumped in the output file. I was expecting it to appear in one of the POST arrays but it's empty.
[_POST] => Array
(
)
[HTTP_POST_VARS] => Array
(
)