0
votes

On one of my Web Projects, I'm trying to implement my server back-end in a (at least nearly) RESTful way. For this, I'm also pretty keen on using the 'correct' HTTP Response Status Codes for the different situations.

The problem i'm standing in front of is the following: My browser/javascript/ajax client allows changing attributes of an persistent object in my db. Because of this PUT request, the name/identificator and thus the URI to access this object (the 'ressource' part specifically) changes.

Currently, im using the 301 Code and placing the new URI in the Location field, as this is how i understood it from http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Is this the way it was intended? OR what would be the 'correct' response? Especially since, if it is the right way, i have to somehow disable the default browser handling of 301 (firefox asks me if i want to send the form data again - to the new URI)

1

1 Answers

1
votes

No, 301 means that the PUT request was not processed, because the resource has moved (and that's why the UA want's to redo the request).