Rest Api Integration

In AppGyver and Data Tab I have followed closely the videos on setting up Rest Api Integration but constantly getting the same error.
To try and avoid the error below in AppGyver I have tried putting this code in my script ‘read.php’
header(“Access-Control-Allow-Origin: *”);

The error is:
Error: TypeError: Failed to fetch. Does the server allow CORS?status: undefined
Resource settings for Get collection (GET)

Resource URL:
Relative path: undefined
End of error notice
The resource brings back data when used in a regular site, see: : Demo To Create Simple REST API with PHP and MySQL

This error usually occurs when a response header, request header, or representational header is missing. For example, “Authorization”, or “Content-Type”.

Many thanks for your suggestion.
I have the code below in my .htaccess script. It works also in POSTMAN but not in AppGyver

Header set Access-Control-Allow-Origin "*"

Header set Access-Control-Allow-Headers: X-Requested-With

Header set Content-Type: application/json