Your question is a little bit vague, like how are you testing this? What device?
I suppose it must be one of the following 2 situations:
Testing in your browser (ex: Google Chrome)
Since you're developing on localhost, you may get these so called CORS-erros.
A simple solution for Google Chrome, would be installing a plugin which handles this.
Install the Google Chrome Allow-Control-Allow-Origin: * extension.
Now your calls won't throw errors hopefully.
Testing on an emulator or a real device after a deploy/build
If you're using a newer version of Cordova (or the latest Ionic CLI) to develop your app, you may be experiencing http 404 errors when your app tries to make network requests.
This can be solved quickly with Cordova Whitelist plugin.
You can find more documentation on Ionic docs: Cordova Whitelist.
Solution:
Run the following command in your shell/terminal:
ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
The only thing you need to do now is to add a property to your config.xml
file:
<allow-navigation href="*" />