We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Each REST-Controller for post/put (repective create/update) ends with this code:
$this->View()->assign(array('success' => true, 'data' => $data)); $this->Response()->setHeader('Location', $location);
Please remove the last line. Returning the json-response ist a better way for the REST-client to determine if the action was successful.
The text was updated successfully, but these errors were encountered:
Hi, thanks for your input.
It's good practise to specify the URI of a newly created resource in the Location response header.
I don't see any drawbacks for including the location header.
Sorry, something went wrong.
Hello,
ok, researching on this topic, you are right! A location header does not alway mean a redirect. The statuscode is ok (200) on success.
No branches or pull requests
Each REST-Controller for post/put (repective create/update) ends with this code:
$this->View()->assign(array('success' => true, 'data' => $data));
$this->Response()->setHeader('Location', $location);
Please remove the last line. Returning the json-response ist a better way for the REST-client to determine if the action was successful.
The text was updated successfully, but these errors were encountered: