2 ms·
With RPC/Telefunc, this is what you do instead: get_tasks({completed:false}) add_task({id, …}) update_task({id, completed}) upsert_task({id, …}) dele
by wruza 4y ago
With RPC/Telefunc, this is what you do instead:
get_tasks({completed:false})
add_task({id, …})
update_task({id, completed})
upsert_task({id, …})
delete_task(id)
Or a meaningful subset of it, also set in stone when appropriate.
There is no reason to start being unreasonable with your APIs once you switch underlying protocols. And no protocol will stop you from doing
POST /sqls <some sql>
Also, pedantically, your POSTs are wrong. You have to PUT (or likely PATCH in this case) into /task/:id, or POST into /tasks.
https://restfulapi.net/rest-put-vs-post/ https://restfulapi.net/rest-put-vs-post/