O'Reilly logo
  • Ruben Leon thinks this is interesting:

Reconfigure the request component in @app/config/web.php:

From

Cover of Yii2 Application Development Cookbook - Third Edition

Note

This sets up the api to accept JSON input and has nothing to do with output formatting.