enabling cors in codeigniter ( restserver by @chriskacerguis )
Try adding OPTIONS to the allowed methods. header(“Access-Control-Allow-Methods: GET, OPTIONS”); header(“Access-Control-Allow-Headers: Content-Type, Content-Length, Accept-Encoding”); and return immediately when the request is method ‘OPTIONS’ once you have set the headers. if ( “OPTIONS” === $_SERVER[‘REQUEST_METHOD’] ) { die(); } See also this answer. Angular sends a W3C CORS spec compliant preflight request that will check for … Read more