This error happens when the .htaccess redirects the request to another url (via GET) or when the user auth is not valid and the request is redirected by default to '/login' page by laravel if the 'Accept: application/json' request header is not present.