My Codeigniter file says
$CI->output->set_header(\"Access-Control-Allow-Origin: *\"); $CI->output->set_header(\"Access-Control-Expose-Headers: Ac
What worked for me is:
$this->output ->set_header('Access-Control-Allow-Origin: http://localhost:4567') ->set_header('Content-type: application/json') ->set_status_header(200) ->set_output( json_encode($to_encode) ) ->_display();