When should I use GET or POST method? What’s the difference between them?

It’s not a matter of security. The HTTP protocol defines GET-type requests as being idempotent, while POSTs may have side effects. In plain English, that means that GET is used for viewing something, without changing it, while POST is used for changing something. For example, a search page should use GET, while a form that … Read more

Should I use PATCH or PUT in my REST API?

The PATCH method is the correct choice here as you’re updating an existing resource – the group ID. PUT should only be used if you’re replacing a resource in its entirety. Further information on partial resource modification is available in RFC 5789. Specifically, the PUT method is described as follows: Several applications extending the Hypertext … Read more

Use of PUT vs PATCH methods in REST API real life scenarios

NOTE: When I first spent time reading about REST, idempotence was a confusing concept to try to get right. I still didn’t get it quite right in my original answer, as further comments (and Jason Hoetger’s answer) have shown. For a while, I have resisted updating this answer extensively, to avoid effectively plagiarizing Jason, but … Read more

tech