开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜