Yii provides two base classes:
\yii\rest\ActiveController that we can extend when we are creating a new controller for RESTful web services.
Both of these classes contain the following useful common features, in execution order:
The second class
\yii\rest\ActiveController adds more functionalities through ActiveRecord, such as handling user authorization and a set of already existing actions:
We will see that Yii provides all the necessary information to get the response status and content through the body and HTTP header.