Welcome Guest, Not a member yet? Register   Sign In
JSON formatting in the browser (missing headers)?
#1

I'm responding from an API using this:

Code:
return $this->setResponseFormat('json')->respond(json_encode($response), 200);

Now, I would 'expect' the proper headers would be set 'automagically' by doing this ... but NOTHING but the data is sent to the browser (no headers for some reason).

What is the 'hack' I need to use to make CI4 send the proper headers without me having to muck around with it?

This is extending the RerourceController ... if that matters.
Reply


Messages In This Thread
JSON formatting in the browser (missing headers)? - by blaasvaer - 02-01-2021, 04:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB