Why POST request creates new record if my code logic is for update?
I read many articles like https://restfulapi.net/rest-put-vs-post/ and there is mentioned that, PUT is for update records and POST for create, because PUT is idempotent. It means if I will send the same request multiple times, it will not create new records instead of POST. But if my code logic is like, on the PUT request I create new record, or on the POST reques开发者_StackOverflow社区t I update record, why it doesn't work? code logic is more important right? because two of these methods body is similar.
精彩评论