Comment

Comment by pixie_

I don't like REST. Making a call to a server should be like calling a function anywhere else - you have your parameters and return value. In REST the parameters are spread over 3 places, the action, the url and the post parameters themselves. It's a much better design to combine all your parameters in one place and keep things simple, for example -

REST version: UPDATE /course/324234 { description: "This is a level 1 course" }

Improved version: POST /course/UpdateDescription { courseId: 324234, description: "This is a level 2 course" }

In this case POST is always used for api calls. Course is the namespace, UpdateDesciption is the method name, and parameters are kept all together as JSON.

parent pixie_ 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton