HTTP.post Cordova is not available


#1

I’m migrating from Ionic 3 to Ionic 4 and have some troubles using the new HTTP function. When I use this.http.post or this.http.get it’s not working when I testrun the app in my browser. I get the message

[Warning] Native: tried calling HTTP.post, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator

But how can I include cordova.js ?


#2

Most Cordova plugins will not work in a browser, this being one of them. The Splashscreen and Statusbar are examples of this.

You can use HTTP directly without the plugin, unless there is special need for the plugin.


#3

Hmm, too bad. I need it because I’ve read the native way to open HTTP connection is the fastest way to do so. It’s working when I test it through DevApp, the only problem there is that I don’t have a way to get logs in the console for debugging purposes.