Kris Jordan recently posted five tips to help you get a "more correct" REST interface in your application.
As we entered a programmable web of applications with APIs the decision to ignore HTTP gave us problems we're still dealing with today. We have an internet full of applications with different interfaces (GET /user/1/delete vs. POST /user/delete {id=1}). With REST we can say /user/1 is a resource and use the HTTP DELETE verb to delete it.
Here's the five (six?) tips:
- Using PUT and DELETE methods
- Send Custom HTTP/1.1 Headers
- Send Meaningful HTTP Headers
- Don't Use $_SESSION
- Test with cURL or rest-client
- Use a RESTful PHP Framework