REST API Design Style

2017-12-15 04:00Edit this page

Regarding HTTP REST-style API design, I currently use two styles:

  1. Write separate GET/POST/PUT/DELETE endpoints for operations on each type of object, then add four corresponding endpoints for each new object type.
  2. Have unified GET/POST/PUT/DELETE endpoints for all objects. If objects are related, use glue code to wrap these four endpoints for customized functionality.

Both design approaches are close to extremes. The Type 1 API that I mainly work on has a terrifying amount of work - I have to make thousands of lines of changes for each new requirement. This is “terrifying” level workload for me, while the API implementation looks simple and non-technical to others, and the deadlines are extremely tight.

So I started looking for a middle ground between these two API approaches. (To be continued)

Unless otherwise stated, articles on this blog are licensed under the Creative Commons Attribution 4.0 International License. Please credit the original author and source when sharing.


Tags:

Leave a comment

Creative Commons © 2013 — 2026 xiaocang | Theme based on fzheng.me & NexT | Hosted by Netlify