3 ms·
The idea is to limit exposed routes to the standard CRUD routes: create (/new), read (/show), update (/edit), delete (/destroy).
by Arcaire 10y ago
The idea is to limit exposed routes to the standard CRUD routes: create (/new), read (/show), update (/edit), delete (/destroy).
- aikah 10y agoI thought the idea was to make an API behave like a webpage by using hyperlinks that represents the state of the application, so in theory a "smart" client could navigate an API autonomously like a human interacts with a web page ? Because otherwise it's no different from RPC.
- anthonybullard 10y agoI think you are thinking of HATEOAS. Read about it here: https://en.wikipedia.org/wiki/HATEOAS?wprov=sfla1 https://en.wikipedia.org/wiki/HATEOAS?wprov=sfla1
- nardi 10y agoUgh, no. The idea is to use standard HTTP verbs (GET, POST, PUT, DELETE) with noun routes, like: Create: POST /resources (or PUT /resources/42) Read: GET /resources/42 Update: PUT /resources/42 (or PATCH /resources/42) Delete: DELETE /resources/42 List/Search: GET /resources