You will receive an error message regarding the response of your sender / receiver cycle.
While this may be a sender problem (which does not send the correct request), it may be caused by a misconfiguration in receiving the PHP script. Of course, even if the request is correct, the receiver, however, does not have HTTP_RAW_POST_DATA .
See: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data
Always populate $ HTTP_RAW_POST_DATA containing raw POST data. Otherwise, the variable is populated only by an unrecognized MIME data type. However, the preferred way to access the original POST data is php: // input. $ HTTP_RAW_POST_DATA is not available with ENCTYPE = "multipart / form data".
So, the first thing to check is whether the $HTTP_RAW_POST_DATA padding is really what the page above requires:
- the .ini variable
always_populate_raw_post_data is True, - or POST is sent with a
Content-Type that the POST handler does not recognize (perhaps you can use "text / raw")
At this point, the right way to send data would be
curl_setopt($handle, CURLOPT_POSTFIELDS, urlencode('Raw POST data'));
However, note that the recommended way to get this data will not rely on $HTTP_RAW_POST_DATA at $HTTP_RAW_POST_DATA , but rather on reading the contents of the php://input virtual file.
php: // input - a read-only stream that allows you to read the source data from the request authority. In the case of POST requests, it is preferable to use the php: // input instead of $HTTP_RAW_POST_DATA , since it does not depend on special php.ini directives. Moreover, for cases when $ HTTP_RAW_POST_DATA is not populated by default, this is a potentially less energy-intensive alternative to always_populate_raw_post_data activation.