This function breaks functionality in our script, as it clears out PUT variable body so nothing is returned when our script tries to subsequently access it.
protected function setRequestBody($config)
{
$this->requestBody = $this->tryGet($config, 'requestBody');
if (!$this->requestBody) {
$this->requestBody = file_get_contents("php://input");
}
}
As file_get_contents("php://input"); can only be called once in older versions of PHP.
See:
Note: Prior to PHP 5.6, a stream opened with php://input could only be read once; the stream did not support seek operations. However, depending on the SAPI implementation, it may be possible to open another php://input stream and restart reading. This is only possible if the request body data has been saved. Typically, this is the case for POST requests, but not other request methods, such as PUT or PROPFIND
This function breaks functionality in our script, as it clears out PUT variable body so nothing is returned when our script tries to subsequently access it.
As file_get_contents("php://input"); can only be called once in older versions of PHP.
See:
Note: Prior to PHP 5.6, a stream opened with php://input could only be read once; the stream did not support seek operations. However, depending on the SAPI implementation, it may be possible to open another php://input stream and restart reading. This is only possible if the request body data has been saved. Typically, this is the case for POST requests, but not other request methods, such as PUT or PROPFIND