From: Andrew Dolgov Date: Thu, 14 Apr 2011 17:22:55 +0000 (+0400) Subject: api: support passing input parameters using JSON in HTTP POST data X-Git-Tag: 1.5.3~45 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=90e71380bad862296084460c2b7d825f56086893;p=tt-rss.git api: support passing input parameters using JSON in HTTP POST data --- diff --git a/api/index.php b/api/index.php index 01328b9a..cebd1c1c 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"]); }