TorrServer icon indicating copy to clipboard operation
TorrServer copied to clipboard

[Feature] RESTful API

Open leon0399 opened this issue 4 years ago • 1 comments

Make all APIs RESTful/CRUD

Example:

Instead of POST /torrents

{
    "action": "add|get|set|rem|list|drop",
    "hash": "<hash>"
}

Make it:

  • INDEX /torrents
  • POST/torrents: { hash: "<hash>", ... }
  • PUT|PATCH /torrents/<hash>
  • DELETE /torrents/<hash>

I know, tht it will be breaking change, but at least it'l make API more user-friendly and easy-to-integrate, so it can be added alongside with current API, with following routes: /api/v2/torrents, etc...

Also it'll help making proper API documentation (#49)

leon0399 avatar Aug 26 '21 14:08 leon0399

INDEX is not standard HTTP verb, avoid it please.

filimonic avatar Feb 20 '24 22:02 filimonic