I have been investigating a problem with data sent to my PHP webservice with a POST request and who were sometimes truncated somewhere in the middle. I have found that it is due to an unescaped ampersand (&) which cut the data in the middle. For example if in POST the data is:
data=foobar&morethings
then I will only have “data” => “foobar” in my $_POST array and the “morethings” part is lost.
The obvious solution would be to fix the software which sends the POST request to my webservice so that it escapes ampersands, but this is not practically possible right now (we can not make our users update the software so easily). Therefore I have to find a temporary workaround.
Is there a possibility, from PHP to retrieve the raw data as it was sent to the webservice before it was parsed by whatever is cutting the POST data in pieces?
http://php.net/manual/en/wrappers.php.php