4 ms·
POST is typically used for creating new entities - the server can determine if the entity should be created - the client might ask for an entity to be created s
by amacalac 3y ago
POST is typically used for creating new entities
- the server can determine if the entity should be created
- the client might ask for an entity to be created several times
PUT is typically used for updating existing entities
- the server can determine if the entity exists before updating it
- imagine where a record might be tried to update twice. you would expect the same output even if the input was used twice (think poor network connection without an ACK from the server back to the client, so the client retries)
- srinivasandoor 3y agoabout updating twice, what if client really wanted to update twice? I did POST with cURL in linux to send data to server, what'd have happened if I used PUT. I did it for sending FCM/GCM to android.