Im having trouble making REST API calls in my ionic app to my server. It shows the following error.
ionic.bundle.js:25005 OPTIONS https://website.com/api/ionic_test 406 (Not Acceptable)
XMLHttpRequest cannot load https://website.com/api/ionic_test. Response for preflight has invalid HTTP status code 406
API call code.
$http.post(API_ENDPOINT.url + '/ionic_test', user).then(function(result) {
if (result.data.status) {
storeUserCredentials(result.data.token);
resolve(result.data.msg);
} else {
reject(result.data.msg);
}
});
ionic.config.json
{
"name": "adminPanel",
"app_id": "",
"proxies": [
{
"path": "/api",
"proxyUrl": "http://website.com/api"
}
]
}