I am trying to fix a callbackurl and in the old system I could simply use a $_POST['order_id']
when trying to retrieve the data. Unfortunately that no longer seems to be possible.
The new system uses this line of code:
$request_body = file_get_contents("php://input");
According to the technical data sheet the order_id
is now simply called id
, but how do I use $request_body
to retrieve it? Something like $request_body['id']
?
What kind of data you send to server? Probably the form is application/x-www-form-urlencoded
encoded, so you can use parse_str function to parse query string.
php://input
contains the raw data after request HTTP headers.
$request_body = file_get_contents("php://input");
$data = array();
parse_str($request_body, $data);
var_dump($data);
If you send JSON for example, you can use json_decode.