0

After reinstall of node_modules.

Suddenly ionic 3 android can't approach backend.

Not azure nor localhost.

Getting "not found" type 2 exception.Without any details

No security restrictions.

At the backend

 protected void Application_BeginRequest(object sender, EventArgs e)
        {
            //HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:8100");
            HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
            if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
            {
                HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST");
                HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept");
                HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
                HttpContext.Current.Response.End();
            }

At the config.xml of Ionic 2

 <access origin="*" />
    <access launch-external="yes" origin="tel:*" />
    <allow-navigation href="*" />
    <allow-navigation href="http://*/*" />
    <allow-navigation href="https://*/*" />
    <allow-navigation href="data:*" />
    <allow-intent href="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

The full exception

"{"_body":"","status":404,"ok":false,"statusText":"Not Found","headers":{"client-via":["shouldInterceptRequest"]},"type":2, "url":"http://.../service1.svc/getCompanies"}"

How can I solve it quickly? At least to get some verbose response explaining the problem.

enter image description here

enter image description here

Tzvi Gregory Kaidanov
  • 3,080
  • 3
  • 26
  • 33
  • I also had this problem and searched a lot then finally... i removed the whitelist plugin: cordova plugin remove cordova-plugin-whitelist then renstalled it cordova plugin add cordova-plugin-whitelist It helped me and hope it solve your problem – Tzvi Gregory Kaidanov Oct 11 '17 at 08:07
  • took it from here https://stackoverflow.com/questions/30122890/ionic-angular-post-request-return-state-404/30209484#30209484 probably a duplicate - it's just I think my descrition of the problem is better – Tzvi Gregory Kaidanov Oct 11 '17 at 08:08
  • Possible duplicate of [Ionic + Angular POST request return state 404](https://stackoverflow.com/questions/30122890/ionic-angular-post-request-return-state-404) – Suraj Rao Oct 11 '17 at 08:13
  • First of all its about Ionic 2/3 and not Ionic 1 , second - as stated I think my question has better description of the problem. – Tzvi Gregory Kaidanov Oct 11 '17 at 20:09

0 Answers0