0

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 ;)

2
  • Maybe your building your URL wrong, Chrome is pretty forgiving, while other browsers are not. Could you check and add information on the URL parameter in Chrome and Safari/your app. Commented May 2, 2016 at 19:52
  • Here is the url : https://example.com/index.php/wc-api/v3/customers/107/orders?consumer_key=ck_XXXX&consumer_secret= cs_XXXX where 107 is the customer id Commented May 3, 2016 at 8:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.