title: Ionic - HTTP Post working on serve and -l but not working when run on android device
body: <pre><code>let headers = new Headers({ 
      'Content-Type' : 'application/json'
  });
  
  let options = new RequestOptions({ headers: headers });
  this.http.post('https://cors-anywhere.herokuapp.com/'+url, body, options)
    .subscribe(data =&gt; {
      let response = JSON.parse(data['_body']);
      if (response.MessageCode == 'SUCCESS') {
        this.loginMessage = 'success';
        this.navCtrl.push(HomePage, response);
      }
      else {
        this.loginMessage = 'failure';
      }
  
     }, error =&gt; {
      console.log(error);
    });
  </code></pre>
  
  <p>I'm having CORS issue. So, I used it before the URL to make it work.</p>
  
  <p>Below is the config.xml</p>
  
  <pre><code>&lt;access origin="*" /&gt;
  &lt;allow-intent href="http://*/*" /&gt;
  &lt;allow-intent href="https://*/*" /&gt;
  &lt;allow-intent href="tel:*" /&gt;
  &lt;allow-intent href="sms:*" /&gt;
  &lt;allow-intent href="mailto:*" /&gt;
  &lt;allow-intent href="geo:*" /&gt;
  &lt;preference name="ScrollEnabled" value="false" /&gt;
  &lt;preference name="android-minSdkVersion" value="16" /&gt;
  &lt;preference name="BackupWebStorage" value="none" /&gt;
  &lt;preference name="SplashMaintainAspectRatio" value="true" /&gt;
  &lt;preference name="FadeSplashScreenDuration" value="300" /&gt;
  &lt;preference name="SplashShowOnlyFirstTime" value="false" /&gt;
  &lt;preference name="SplashScreen" value="screen" /&gt;
  &lt;preference name="SplashScreenDelay" value="3000" /&gt;
  &lt;plugin name="cordova-plugin-splashscreen" spec="^5.0.2" /&gt;
  &lt;plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" /&gt;
  &lt;plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" /&gt;
  &lt;plugin name="cordova-plugin-device" spec="^2.0.1" /&gt;
  &lt;plugin name="cordova-plugin-whitelist" spec="^1.3.3" /&gt;
  &lt;plugin name="cordova-plugin-advanced-http" spec="^1.11.0" /&gt;
  </code></pre>
  
  <p>Request headers-</p>
  
  <pre><code>Accept: */*
  Accept-Encoding: gzip, deflate
  Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
  Access-Control-Request-Headers: content-type
  Access-Control-Request-Method: POST
  Connection: keep-alive
  Host: 64.77.72.122
  Origin: http://localhost:8100
  </code></pre>
  
  <p>Response headers-</p>
  
  <pre><code>Connection: close
  Content-Length: 1245
  Content-Type: text/html
  Date: Thu, 15 Mar 2018 15:37:44 GMT
  Server: Microsoft-IIS/8.5
  X-Powered-By: ASP.NET
  </code></pre>
  
  <p>I have tried all the options mentioned in other similar questions like the one mentioned below.</p>
  
  <p><a href="https://stackoverflow.com/questions/30326148/cordova-ionic-http-request-not-processing-while-emulating-or-running-on-dev">this</a></p>
  
  <p>Can someone address this issue? TIA.</p>