# Web api call is failing in higher versions of android

**URL:** <https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505>\
**Category:** cordova\
**Created:** [June 25, 2018, 4:58am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505 "2018-06-25T04:58:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruby4leo](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ruby4leo](https://forum.ionicframework.com/u/ruby4leo)\
**Post date:** [June 25, 2018, 4:58am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/1 "2018-06-25T04:58:19Z")

</div>

In Ionic 3 Angualar 5 application. The below MVC call is failing in Android 7 and above works fine in Android 5. Any guess why?

````auto
> import { HttpClient } from '@angular/common/http';
> 
> 
> ```
> > constructor(private http: HttpClient) {}
> > .........
> > .........
> > > this.http.post('http://www.mymvcsite.com/controller/action' +'?param1=val1&param2=val2&param3=val3', null).pipe(
> > > map(this.extractData),
> > > catchError(this.handleError)
> > > );
> ```

````

I am in doubt that because the site is insecure (http not https) the upgraded android versions must be preventing the call, but not sure if that is the cause, I am not android programming expert, please help.

---

<div class="post-metadata">

**Author:** ![ansarikhurshid786](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@ansarikhurshid786](https://forum.ionicframework.com/u/ansarikhurshid786)\
**Post date:** [June 25, 2018, 10:13am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/2 "2018-06-25T10:13:57Z")

</div>

Use angular observable instead http plugin.

---

<div class="post-metadata">

**Author:** ![ruby4leo](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ruby4leo](https://forum.ionicframework.com/u/ruby4leo)\
**Post date:** [June 25, 2018, 10:34am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/3 "2018-06-25T10:34:23Z")

</div>

Thanks can you please suggest a sample code

---

<div class="post-metadata">

**Author:** ![ansarikhurshid786](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@ansarikhurshid786](https://forum.ionicframework.com/u/ansarikhurshid786)\
**Post date:** [June 25, 2018, 10:38am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/4 "2018-06-25T10:38:13Z")

</div>

sure i will share example. can i know in which platform are you facing problem like browser or android or ios?

---

<div class="post-metadata">

**Author:** ![ruby4leo](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ruby4leo](https://forum.ionicframework.com/u/ruby4leo)\
**Post date:** [June 25, 2018, 10:45am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/5 "2018-06-25T10:45:03Z")

</div>

The code failed in Android version 7. The same code worked fine in Android 5 and while tested in chrome using \>ionic serve command  
I have checked one of the sample code [https://scotch.io/tutorials/angular-2-http-requests-with-observables](https://scotch.io/tutorials/angular-2-http-requests-with-observables) my code uses @angular/common/http instead @angular/http

---

<div class="post-metadata">

**Author:** ![ansarikhurshid786](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@ansarikhurshid786](https://forum.ionicframework.com/u/ansarikhurshid786)\
**Post date:** [June 25, 2018, 10:59am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/6 "2018-06-25T10:59:41Z")

</div>

Your are using right one.

---

<div class="post-metadata">

**Author:** ![ansarikhurshid786](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@ansarikhurshid786](https://forum.ionicframework.com/u/ansarikhurshid786)\
**Post date:** [June 25, 2018, 11:00am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/7 "2018-06-25T11:00:48Z")

</div>

can you post any error log, which you are getting in android version 7?

---

<div class="post-metadata">

**Author:** ![ruby4leo](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@ruby4leo](https://forum.ionicframework.com/u/ruby4leo)\
**Post date:** [June 25, 2018, 11:06am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/8 "2018-06-25T11:06:05Z")

</div>

Unfortunately I don’t have this android version in my test environment, I could notice only in the production right now, ionic simulator only simulates cordova version, for simulating specific android version i need to use android studio. can I execute the generated .apk in android studio emulator?

---

<div class="post-metadata">

**Author:** ![ansarikhurshid786](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@ansarikhurshid786](https://forum.ionicframework.com/u/ansarikhurshid786)\
**Post date:** [June 25, 2018, 1:20pm UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/9 "2018-06-25T13:20:53Z")

</div>

without error log how can we assume what is exact error.

---

<div class="post-metadata">

**Author:** ![Gopinadh](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@Gopinadh](https://forum.ionicframework.com/u/Gopinadh)\
**Post date:** [October 5, 2020, 9:05am UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/10 "2020-10-05T09:05:27Z")

</div>

Hi,  
I have the same issue in android version 6 above.  
Following error i am getting when i call the rest api with https secure url.

 ![WhatsApp Image 2020-10-05 at 14.34.44](https://global.discourse-cdn.com/ionicframework/original/3X/c/2/c27d07c57681feaf3e71fe3c9dc3bec47a0d738b.jpeg)

---

<div class="post-metadata">

**Author:** ![erkinalan](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/erkinalan/32/131643_2.png) [@erkinalan](https://forum.ionicframework.com/u/erkinalan)\
**Post date:** [October 5, 2020, 2:25pm UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/11 "2020-10-05T14:25:19Z")

</div>

Extract the apk in debug mode and check the error from devTools. Or share with us.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 8:54pm UTC](https://forum.ionicframework.com/t/web-api-call-is-failing-in-higher-versions-of-android/133505/12 "2021-07-19T20:54:03Z")

</div>

Closed on July 19, 2021, 8:54pm UTC


