diff --git a/library/Icingadb/Web/Controller.php b/library/Icingadb/Web/Controller.php index 91b28a044..aa083a70a 100644 --- a/library/Icingadb/Web/Controller.php +++ b/library/Icingadb/Web/Controller.php @@ -513,7 +513,12 @@ public function preDispatch() { parent::preDispatch(); - $this->format = $this->params->shift('format'); + $this->format = $this->params->shift( + 'format', + $this->getRequest()->isApiRequest() + ? 'json' + : null + ); } public function postDispatch()