REST
ClearPress supports working in a RESTful fashion. That is to say there is a very systematic naming scheme for addressing entities and supporting the operations usually required:
- create
- read
- update
- delete
- list
- add
- edit
The URL scheme looks something like this:
- Create
POST to http://server/application/entity- Read
GET from http://server/application/entity/id- Update
POST to http://server/application/entity/id- Delete
POST to http://server/application/entity/id;delete- Entity list
GET http://server/application/entity/- Add entity form
GET http://server/application/entity/id;add- Edit entity
GET http://server/application/entity/id;edit
On the whole this is fine - default responses are in text/html and that's great. Occasionally we want to use XML or JSON representations - simple!
- Entity list in XML
GET http://server/application/entity.xml- Entity in JSON
GET http://server/application/entity/id.js- Entity image
GET http://server/application/entity/id.png