Home > Software design >  POST or GET for triggering an update
POST or GET for triggering an update

Time:05-06

I have a Spring-Boot application and want to trigger an update method via an endpoint in my Controller class. I can´t decide wheather to use a PUT or POST. On the one hand updating my application via this endpoint sounds for me like a POST but in the other hand it will be a simple call without sending any data, which sounds for me like a GET.

CodePudding user response:

GET methods should be be idempotent and (usually) have no side effects. That makes an empty POST a better option.

CodePudding user response:

Update is PUT, Post is send data, Get is get Data, delete is delete data, in update you must specified na unique like sample id to update the data

  • Related