Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN: Which APIs have the best developer experience?.
2. Repeat (1)
3. Make endpoints self explanatory. For example -
GET /users - To list all users
POST /users - To create a user
PUT /users/:userId - To update a user profile
PATCH /users/:userId - To patch a user profile (Great if you can support JSONPatch syntax)
Never add unnecessary verbs in the route like /users/create which can easily be represented by the HTTP Request Method.
Just my few cents
There are no comments on this comment yet.
2. Repeat (1)
3. Make endpoints self explanatory. For example -
GET /users - To list all users
POST /users - To create a user
PUT /users/:userId - To update a user profile
PATCH /users/:userId - To patch a user profile (Great if you can support JSONPatch syntax)
Never add unnecessary verbs in the route like /users/create which can easily be represented by the HTTP Request Method.
Just my few cents