I work with ionic and angularJS to build a mobile app.
But I have a problem : HTTP request return 404 in the app and on Safari, but in Google Chrome, the request return correct JSON.
In the app I have install the cordova white list plugin.
I have add <access origin="*" /> + <allow-intent href="*"/> + <allow-navigation href="*"/> in the config.xml.
And <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"><meta http-equiv="Content-Security-Policy"
content="default-src *; [...]; script-src http://localhost:35729 'self' 'unsafe-inline' 'unsafe-eval'" /> in index.html.
Here is my code :
$http({
method: 'GET',
url: url,
cache: false,
timeout: 10000
}).success(function (data, status, headers, config) {
alert(JSON.stringify(status));
// handle success things
deferred.resolve(data);
}).error(function (data, status, headers, config) {
// handle error things
alert(JSON.stringify(status));
alert(JSON.stringify(headers));
alert(JSON.stringify(config));
deferred.reject(data);
});
And it return 404. What I am doing wrong ?
Thanks you for help me ;)
https://example.com/index.php/wc-api/v3/customers/107/orders?consumer_key=ck_XXXX&consumer_secret= cs_XXXXwhere107is the customer id