Rest(php) xmlhttprequest problem - Resolved

what is the problem ?

var body = `username=${username}&password=${password}`;
        .map(response => response.json())
           response => {

The problem is called CORS, and is in the server.

You must set headers to allow HTTP calls from different domains that is not the API domain.

You can try to add in your PhP REST function the following header and see if it works:

header('Access-Control-Allow-Origin: *');
1 Like

Thank you @Adonai, Resolved. With your reply.

1 Like