api: support passing input parameters using JSON in HTTP POST data
This commit is contained in:
parent
a0e580b0ca
commit
90e71380ba
|
@ -21,6 +21,17 @@
|
||||||
|
|
||||||
session_name($session_name);
|
session_name($session_name);
|
||||||
|
|
||||||
|
$input = file_get_contents("php://input");
|
||||||
|
|
||||||
|
// Override $_REQUEST with JSON-encoded data if available
|
||||||
|
if ($input) {
|
||||||
|
$input = json_decode($input, true);
|
||||||
|
|
||||||
|
if ($input) {
|
||||||
|
$_REQUEST = $input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($_REQUEST["sid"]) {
|
if ($_REQUEST["sid"]) {
|
||||||
session_id($_REQUEST["sid"]);
|
session_id($_REQUEST["sid"]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue