This looks like a CORS issue. Are you sure you’re handling the OPTIONS pre-flight request correctly?
OPTIONS http://broubrou.olympe.in/util/stack/headers-demo/api/guys.php
XMLHttpRequest cannot load http://broubrou.olympe.in/util/stack/headers-demo/api/guys.php.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'
header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed
access. The response had HTTP status code 404.
(same thing happens locally if running on different ports)
Solved !
1 000 thanks: I’ve been struggling on this issue for so long !
Effectively, my backend was not sending the correct CORS headers.
The tricky thing was that for an unknown reason, my version of Firefox (Developer Edition…) didn’t display the failing OPTIONS request in my Network Inspector at the point of my debugging. I thus had no debugging information at all there.
I could only observe the failing preflight using… Wireshark !
It may have been a bug solved in a Christmas update, as I can’t reproduce it today. Too bad…