Some time we get Cross origin requests error while working with angular. here is a working solution how to resolve this error

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Content-Type: application/json');

🙂