What is the difference if I always use POST
method to update a row in the MySQL or Cassandra database instead of PUT
?
I ask this because when I did research on that I read in some other questions that were saying POST
request causes multiple instances creation. I wanted to make sure if is that correct?
2
Answers
Neither mysql nor Cassandra will even be aware if the client made a http put or post request, so from a database point of view it is totally irrelevant which http request type you use.
The database doesn’t care about how the server talks to clients.
Technically you could use POST for everything. That’s basically how GraphQL works. But doing that means your API is not RESTful.
These are the basic RESTful API methods:
That being said, if you feel like your use-case works and reads better with just POST or GET, go for it.