I am a newbie to REST
However, I plan to develop a web application with REST and started with the following code,
$app->get('/users', 'getUsers');
$app->get('/users/:id', 'getUser');
$app->get('/users/search/:query', 'findByName');
$app->post('/users', 'addUser');
$app->put('/users/:id', 'updateUser');
$app->delete('/users/:id', 'deleteUser');
Update :
I use to handle by
domain.com/user/1 (I don't have any confusion in it)
I understand the simplicity of url and using the GET, PUT, POST, DELETE
but my major doubt is
If i handle it by
?id=1|action=delete ?id=2|action=insert
and had the conditions inside the page like
splitting the got parameter by the pipe symbol and assigning the actions and if i check like if action is delete, or insert like that , then what is the purpose of using REST ?
Or if i didn't understood the usage of REST, Kindly convey the main purpose and benefits of REST