From 04c7e4ea8f5e8e4f27fedd36c0d1a0b9d245b42e Mon Sep 17 00:00:00 2001 From: perfectio Date: Wed, 8 Nov 2017 15:59:20 +0200 Subject: [PATCH] Update Action.php Content-Type: application/json response header --- Action.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Action.php b/Action.php index 070e40b..21ed1f3 100644 --- a/Action.php +++ b/Action.php @@ -28,6 +28,9 @@ public function run() $this->exception = new Exception($e->getMessage(), Exception::INTERNAL_ERROR); } Yii::endProfile('service.request'); + + Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + return $this->toJson(); }