If you are using localhost
and PHP set to this to solve the issue:
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
From your front-end use:
{headers: {"Content-Type": "application/json"}}
and boom no more issues from localhost
!