I've tried all of them methods on could find that have worked for other folks, but with no luck.
Here's my PHP code:
parse_str(file_get_contents("php://input"), $put_data);
echo "foo is: " . $put_data['foo'] . "
";
No matter what I try, I get 'foo is: '
I'm thinking this is specific to Apache as running the same script on an nginx server shows the expected 'foo is: bar'
Things I've tried with no change in the result:
Changing my Content-Type header to application/x-www-form-urlencoded.
Adding a LimitExcept directive to my apache config, like so (yes, I restarted after making the change)
<Directory "/MyApp/Directory/">
Allow From All
AllowOverride All
<LimitExcept GET POST PUT OPTIONS DELETE>
Deny from All
</LimitExcept>
</Directory>
Using stream_get_contents like so:
$put_data = fopen("php://input", "r");
$data = stream_get_contents($put_data);
echo "data is: " . $data;
fclose($put_data);
Here are the response headers:
Date: Wed, 11 Jun 2014 04:03:09 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y
X-Powered-By: PHP/5.4.24
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 7
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Thanks to any who can offer help. Pulling what's left of my hair out on this one for hours now.