Creating RESTful Services in DataFlex: Difference between revisions

m
Link
m (Typo)
m (Link)
Line 3: Line 3:
It is often said that REST is not CRUD, by which it is meant that REST operations should not simply be considered as the basic database operations: '''C'''reate, '''R'''ead, '''U'''pdate and '''D'''elete.
It is often said that REST is not CRUD, by which it is meant that REST operations should not simply be considered as the basic database operations: '''C'''reate, '''R'''ead, '''U'''pdate and '''D'''elete.


And this is true, however REST <u>does</u> provide us with the tools to perform those operations. As discussed under [[#Verbs|Verbs]] above, the verb PUT is unsuitable for most database operations, due to the requirement that it be idempotent. This leaves us with the verbs GET, POST, PATCH and DELETE, which ''do'' map nicely onto those database operations:
And this is true, however REST <u>does</u> provide us with the tools to perform those operations. As discussed under [[RESTful Service Theory#Verbs|Verbs]] above, the verb PUT is unsuitable for most database operations, due to the requirement that it be idempotent. This leaves us with the verbs GET, POST, PATCH and DELETE, which ''do'' map nicely onto those database operations:


*'''C'''reate - '''POST''' (to a ''collection'', since in general the instance ID will not be known, but will be a serial ID allocated by the application)
*'''C'''reate - '''POST''' (to a ''collection'', since in general the instance ID will not be known, but will be a serial ID allocated by the application)