4 ms·
The one thing I would tell people implementing an HTTP API; create a non-trivial sample application using the API. The benefits of this are many: 1) You will
by mmcnickle 15y ago
The one thing I would tell people implementing an HTTP API; create a non-trivial sample application using the API.
The benefits of this are many:
1) You will create a client library for your API in at least one language. You can release this along with the API which will make it easier for people to adopt the API. It will also serve as an example of best practices for interfacing with your API for other client library authors.
2) You will be forced to really think about what representations people using the API will want to consume. Too many people expose an API that is just a wrapper around their data models. Your data models are rarely structured in an appropriate way: i.e. a blog_post might have a user_id, but most API users would appreciate being passed some form of a user representation there, rather than make another API call.
3) The application serves as an end-to-end test of your API (though obviously isn't sufficient in terms of testing)
- RyanMcGreal 15y agoI would go one further: build your API first, and build your application on top of it.