HTTP
Cordova / Phonegap plugin for communicating with HTTP servers. Supports iOS and Android.
Advantages over Javascript requests:
- SSL / TLS Pinning
- CORS restrictions do not apply
- Handling of HTTP code 401 - read more at Issue CB-2415
Note: This plugin extends the pre-existing cordova-advanced-http-plugin, we have only added approov functionality on top of it. All credit goes to the actual plugin developer.
https://github.com/approov/quickstart-ionic-advancedhttp
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionicβs experts offer premium advisory services for both community plugins and premier plugins.
Installation
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-approov-advanced-http
$ npm install @awesome-cordova-plugins/approov-advanced-http
$ ionic cap sync
$ ionic cordova plugin add cordova-approov-advanced-http
$ npm install @awesome-cordova-plugins/approov-advanced-http
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Β Learn More or if you're interested in an enterprise version of this plugin Contact Us
Supported Platforms
- Android
- iOS
Usage
React
Learn more about using Ionic Native components in React
Angular
import { ApproovHttp } from '@awesome-cordova-plugins/http/ngx';
constructor(private http: ApproovHttp) {}
...
this.http.get('http://ionic.io', {}, {})
.then(data => {
console.log(data.status);
console.log(data.data); // data received by server
console.log(data.headers);
})
.catch(error => {
console.log(error.status);
console.log(error.error); // error message as string
console.log(error.headers);
});