- $this->params = (isset($_REQUEST['data'])) ? json_decode(stripslashes($_REQUEST['data']), true) : null;
- $this->id = (isset($_REQUEST['id'])) ? json_decode(stripslashes($_REQUEST['id']), true) : null;
+ $this->params = (isset($_REQUEST['data'])) ? json_decode(stripslashes($_REQUEST['data'])) : null;
+
+ if (isset($_REQUEST['data'])) {
+ $this->params = json_decode(stripslashes($_REQUEST['data']));
+ } else {
+ $raw = '';
+ $httpContent = fopen('php://input', 'r');
+ while ($kb = fread($httpContent, 1024)) {
+ $raw .= $kb;
+ }
+ $params = json_decode(stripslashes($raw));
+ if ($params) {
+ $this->params = $params->data;
+ }
+ }
+