mstdmstdd Posted October 3, 2017 Share Posted October 3, 2017 Hi all,Here there http status codes:https://en.wikipedia.org/wiki/List_of_HTTP_status_codesand they have 201 Created The request has been fulfilled, resulting in the creation of a new resource But I do not see which status must returned in case of resource updated ?I make REST API using php with possibility to update resource(PUT request).Which code better to return here ?Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/305190-which-http-status-codes-return-for-put-request/ Share on other sites More sharing options...
requinix Posted October 3, 2017 Share Posted October 3, 2017 There is no "resource updated" response. Just use 200. 1 Quote Link to comment https://forums.phpfreaks.com/topic/305190-which-http-status-codes-return-for-put-request/#findComment-1552279 Share on other sites More sharing options...
gizmola Posted October 3, 2017 Share Posted October 3, 2017 I agree with requinix, but you can also look at 204 & 205 status if you decide those are better suited to your use case and design. Quote Link to comment https://forums.phpfreaks.com/topic/305190-which-http-status-codes-return-for-put-request/#findComment-1552295 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.