yii2 restfull webservices where to config the request to xml to json format

Hai new in yii2 using yii2.0.2 with restfull webservices ,by default xml based getting response the database values in xml format ,but i want to show json ,please let me know where to config the display format json ,I got code bellow added but i want to know where t omake config

‘request’ => [

'parsers' => [


    'application/json' => 'yii\web\JsonParser',


]

]

please let me know

Hi,

use this code:


Yii::$app->response->format = 'json';