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
Unless I am using it wrong it looks like the response->setJSON method is not working
response->setJSON
I setup a very basic test controller as shown below:
class Foo extends BaseController { public function bar() { $testData = [ 'success' => true, 'id' => 123, ]; $this->response->setStatusCode(401)->setJSON($testData); } }
When I run the url in Postman I get the response code I set but body is empty. Am I missing something?
The text was updated successfully, but these errors were encountered:
Can you try returning the response object?
Sorry, something went wrong.
Crap, need new glasses. It works like a charm - developer issue, not framework ;)
No branches or pull requests
Unless I am using it wrong it looks like the
response->setJSON
method is not workingI setup a very basic test controller as shown below:
When I run the url in Postman I get the response code I set but body is empty. Am I missing something?
The text was updated successfully, but these errors were encountered: