Let's see the tasks we have to accomplish on the API level. We will update the get()
method that returns the wall data to include all the statuses of the user, and we will also add a new method called create()
to be able to insert new status into the database for a specific user. In order to do that we need to add a new table in the database and the corresponding table gateway. After that we'll add a new route for the create()
method. Finally on the API side, we will see how to validate and filter the data that comes from the client.
In order to post a new status, we will modify the endpoint we created in Chapter 4, The First Request/Response – Building the User Wall, to accept the POST
requests. Let's see the formal requirements of the new method in the following table:
HTTP method |
Controller method |
Parameters |
Functionality |
---|---|---|---|
|
|
|
This is the only method providing data to the world. The |