Redirecting with a 201 created

I think you’re confusing two different semantic responses – one is telling the client that you successfully created a resource, and where it is. Whether the client goes to fetch it or not is a different story.

The second is telling the client that it has sent the wrong location URI for a resource it’s requesting – and that it should try again, but with a different URI.

A 303 is appropriate in this case – in fact, it’s explicitly recommended for this:

(from rfc)

It is primarily used to allow the output of a POST action to redirect the user agent to a selected resource, since doing so provides the information corresponding to the POST response in a form that can be separately identified, bookmarked, and cached, independent of the original request.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)