Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C - PUT - Create
R - GET - Read
U - POST - Update
D - DELETE - Delete
Not real hard to understand -
Its easy:
Create: updates items
Read: deletes items (its called Read Once Memory for a reason right?)
Update: create a new item
Delete: same as the read method, they just added it to make the abbreviation sound better -
mundo0349796y@PerfectAsshole post can get too used when the payload is too big as a C from CRUD.
This shit is becoming more common every day. So maybe reality can bent theory -
@mundo03 post should hit a limit before put. But incases of too much data implementing a ranged update is usually the sain option
-
@Arlind it's different everywhere. It's one of the things nobody agrees on, i was taught post/patch updates and put creates
-
@Arlind @PerfectAsshole
What Ive learned was:
Post and put contain the complete resource to create/update
Patch only contains the changes to be updated.
I did not learn if post or put should be used for creating/updating. -
@Codex404 like i said nobody agrees on it. One of the reasons i say even shitty docs are better than nothing.
-
@Codex404 Consensus on SO seems to be that PUT is performed to create an entity at a specific URL (with known "id"), while POST is used to create an entity below a specific URL (when you don't know the "id" in advance):
PUT /products/1729
or
POST /products/ -
devios157706y@PerfectAsshole I believe PUT is idempotent while POST is not, therefore it should be the other way around.
-
@devios1 from what i learned GET and OPTIONS are the only impotent operations
-
@devios1 oh was thinking of the wrong thing. I was thinking impotence was when nothing is changed. PUT should be impotent as long as the same data is entered
-
devios157706y@PerfectAsshole It’s idempotent not impotent 🙂 but yeah you got it. With PUT you can submit the same request multiple times and it will be the same as calling it once. Not the case with POST.
-
@devios1 haha yeah please excuse my word changes, ive been drinking for 6 hours now
Boss argued with me over whether CRUD create adds data or updates it...
rant