diff --git a/library/Icinga/Web/Request.php b/library/Icinga/Web/Request.php index bedcd44d7..88fb729cb 100644 --- a/library/Icinga/Web/Request.php +++ b/library/Icinga/Web/Request.php @@ -3,6 +3,7 @@ namespace Icinga\Web; +use Icinga\Util\Json; use Zend_Controller_Request_Http; use Icinga\Application\Icinga; use Icinga\User; @@ -120,4 +121,11 @@ class Request extends Zend_Controller_Request_Http return $id . '-' . $this->uniqueId; } + + public function getPost($key = null, $default = null) + { + return $key === null && $this->isApiRequest() + ? Json::decode(file_get_contents('php://input'), true) + : parent::getPost($key, $default); + } }