Jeremy Brown, after working tirelessly on a REST API based around the Zend Framework (and a few other technologies), has come up with his three tenets for implementing a REST API to hopefully help you along the straight and narrow path that he forged himself.
In the course of performing my duties at my day job I recently came across the need for our data to be accessible via an API. After researching the various types available, I settled on developing a REST API. The selection process wasn't the interesting part of this exercise though. Actually implementing a REST API is what was.
His advice ranges from the general to very specific, sharing tips on how to most effectively create the service's API:
- REST is a set of principles (and not a specification)
- Do not use custom media types
- Represent the headers in the response payload
没有评论:
发表评论