skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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:

    Method Description
    GET Retrieve information about the REST API resource
    POST Create a REST API resource
    PUT Update a REST API resource
    DELETE Delete a REST API resource or related component

    That being said, if you feel like your use-case works and reads better with just POST or GET, go for it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search