api - Correct HTTP Response when resource changed -
i'm implementing rest web api .net core. 1 of action have in web api updating location of specific user..
[httpput("{username:username}/{regionname:regionname}", name = "updateuser")] public async task<iactionresult> updateuser([fromroute][required]string username, [fromroute][required]string regionname, [frombody][required]updateuserviewmodel user) { //..some code here }
i.e. when operation finished, location of resource changed, if request in beginning was:
request1: put "localhost:5000/controller/usernamehere/location1" , updated "location2"
after request1 ends, new location request2: put"localhost:5000/controller/usernamehere/location2" , location in request1 irrelevant.
my question : best practice response (status code, location) returned in case?
thanks!
Comments
Post a Comment