$http call fails while deployed in Windows 10 UWP

I have created an Ionic1 app for windows 10 UWP. Basically data stored locally from application using SQLite database and saved details will be moved to live server once the application connected to internet.

We use ASP.NET MVC WebAPI for handing live database related works. The problem here is ajax call (XmlHttpRequest) failed to webapi while deploying the app into device and it is working fine while debugging in browser.

While running, “ionic serve”, it is working perfectly in all browsers including “Edge”.

While running “ionic run windows --uap --archs=x86”, ajax call fails. ( I build the application using “ionic build windows --uap --archs=x86”)

Content Security Policy included in index.html: < meta http-equiv=“Content-Security-Policy” content=“default-src *; style-src ‘self’ ‘unsafe-inline’; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’”’ />

allow-navigation config.xml: ‘< allow-navigation href=“http:////” / >’

Can any one please help me out from this issue ? (I’m banging my head for this nearly 4 days and trying all possible solutions which I found in any of the forums)

Thanks in advance.

Thank @thesourav for your prompt answer.

Finally I found the root cause of the failure while running the application in visual studio as UWP JavaScript application.

SCRIPT7002: XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff.
index.html

Do you have any idea to solve this??

This is a typical CORS issue. If you are running it in browser, you will get this issue. If you run it on device,you will be fine.
For browser, you have to make the server allow the origin(for e.g https://localhost:8080) on which you are calling the xhr method.
Depending upon the server, you can find tons of example for Access-Control-Allow-Origin on Internet to tackle this

No. I kindly remind you once again that I’m facing this issue only when the app deployed in device and it is working fine in browsers since I already enabled CORS in ASP.Net WebAPI.

I surfed for the solution in internet a lot and came across a small piece of information that port forwarding should be configured in server to enable it to make connection to non SSL softwares.

port redirection over a private / public port issue from jQuery / JS