Wanting to make a public API using PHP GET method but it says CORB issue

Website URL

My Website Is https://exterware.kesug.com/s

Error Message

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://exterware.kesug.com/api/search?token=secretcantshow&search=exterseb. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Other Information

So uh i wanted to create an api which anyone could use to communicate with my search database but when i test it on another page it says this error:
the error on top
but ive added the headers:

header(“Access-Control-Allow-Origin: *”);

header(“Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS”);

header(“Access-Control-Allow-Headers: Content-Type, token, searchquery”);

oops accidently added an s after the url.
URL is: https://exterware.kesug.com

Please read

8 Likes

oh… so i have to host it somewhere else?

Unfortunately, yes. Our hosting can only be used for websites, not APIs.

6 Likes