TutorialsPoint defines the following methods claiming it as RESTful design:
S. N. URI HTTP Method POST body Result
1 listUsers GET empty Show list of all the users.
2 addUser POST JSON String Add details of new user.
3 deleteUser DELETE JSON String Delete an existing user.
4 :id GET empty Show details of a user.
I think this is misleading, wrong and not RESTful.
RESTful design would have the following:
S. N. URI HTTP Method POST body Result
1 users GET empty Show list of all the users.
2 users POST JSON String Add details of new user.
3 users/{id} DELETE empty Delete an existing user.
4 users/{id} GET empty Show details of a user.
Aucun commentaire:
Enregistrer un commentaire