Rest API call from Ionic app


I am new to Ionic. I just started developing my 1st app.

I am just making a rest call just to display city list. Intially I have faced CORS problem and I have rsolved it by refering to

I have added the proxy block as mentioned below to my ionic.project file.
“proxies”: [
“path”: “/renu/api/GetStations/RBKAL/RBKAL”,
“proxyUrl”: “

Below is my controller code where I am making rest call
method : “GET”,
//url : "http://localhost:8100/renu/api/GetStations/RBKAL/RBKAL"
url: “file://renu/api/GetStations/RBKAL/RBKAL”
}).then(function mySucces(response) {
$scope.selectables =
}, function myError(response) {


It works fine with url: "http://localhost:8100/renu/api/GetStations/RBKAL/RBKAL while running throught ionic serve. But when I change the url to file://renu/api/GetStations/RBKAL/RBKAL to genereate apk file to deploye it under andriod device as suggested in It’s not working. So if anyone knows how to reframe the URL while generting the apk file, guide me to solve this issue.


After googling it for 2 days I have found the solution.
Just install Cordova Whitelist plugin to your project directory then build the apk file. It worked for me.

ionic plugin add