Search docs/
Getting StartedPlugins

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
https://github.com/silkimen/cordova-plugin-advanced-http

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.

Contact Us Today!

Installation

ionic cordova plugin add cordova-plugin-advanced-httpnpm install @ionic-native/httpnpm install cordova-plugin-advanced-httpnpm install @ionic-native/httpionic cap sync
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

See here.

Angular

import { HTTP } from '@ionic-native/http/ngx';

constructor(private http: HTTP) {}

...

this.http.get('https://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);

  });