Modifying data with PUT
Depending on whom you ask, PUT
and POST
can be used interchangeably for the creation of records. Some people believe that both can be used for updating the records and most believe that both can be used for the creation of records given a set of variables. In lieu of getting into a somewhat confusing and often political debate, we've separated the two as follows:
- Creation of new records:
POST
- Updating existing records, idempotently:
PUT
Given these guidelines, we'll utilize the PUT
verb when we wish to make updates to resources. We'll allow comments to be edited by anyone as nothing more than a proof of concept to use the REST PUT
verb.
In Chapter 6, Session and Cookies, we'll lock this down a bit more, but we also want to ...
Get Go: Building Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.