Skip to content

Instantly share code, notes, and snippets.

@AucT
Last active November 30, 2022 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AucT/b2f8ec54b39abbf4a266b40227e18483 to your computer and use it in GitHub Desktop.
Save AucT/b2f8ec54b39abbf4a266b40227e18483 to your computer and use it in GitHub Desktop.

Simple API - a mix of rest and RPC

There are a lot of time when you need a ton of actions but rest API docs with noun doesn't help much, and implementing proper RPC style will need a lot of changes and will not work for simple HTML forms.

Simple API spec

  1. HTTP GET for queries. GET requests are made in REST style.
/articles
/articles/1
  1. HTTP POST for commands and everything else. POST requests are made using normal verbs and params like in HTML form.
/article/create
/article/update
/article/delete
/article/star
/article/unstar
/article/watch
/article/unwatch
/article/favourite
/article/unfavourite
/article/follow
/article/unfollow

/server/restart
/settings/update
/image/process

That's all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment