JSON formatting in the browser (missing headers)? |
PHP Code: return $this->setResponseFormat('json')->respond(['error' => false]); PHP Code: // setResponseFormat($format) example code with browser output (pic, CI4.1 php 7.3) https://yadi.sk/i/VBFIGIaF-TLF2g You can actually use setJSON() if you're comfortable. I'm just showing that the example from the documentation works. And by the way, when you passed the JSON string in the first example, the header was setted to text/html link to code |
Messages In This Thread |
JSON formatting in the browser (missing headers)? - by blaasvaer - 02-01-2021, 04:28 AM
RE: JSON formatting in the browser (missing headers)? - by iRedds - 02-01-2021, 06:02 AM
RE: JSON formatting in the browser (missing headers)? - by blaasvaer - 02-01-2021, 06:05 AM
RE: JSON formatting in the browser (missing headers)? - by iRedds - 02-01-2021, 10:24 AM
|