diff options
author | Andrew Dolgov <[email protected]> | 2011-04-14 21:22:55 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-04-14 21:22:55 +0400 |
commit | 90e71380bad862296084460c2b7d825f56086893 (patch) | |
tree | 359369ed81ae73adae29a00d71a9dcf830e676fa /api | |
parent | a0e580b0ca6e42362e692240cd1193907b8b230b (diff) |
api: support passing input parameters using JSON in HTTP POST data
Diffstat (limited to 'api')
-rw-r--r-- | api/index.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/api/index.php b/api/index.php index 01328b9a7..cebd1c1c4 100644 --- a/api/index.php +++ b/api/index.php @@ -21,6 +21,17 @@ 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"]) { session_id($_REQUEST["sid"]); } |