# Test web api works on Ionic lab and emulator but not in device

**URL:** <https://forum.ionicframework.com/t/test-web-api-works-on-ionic-lab-and-emulator-but-not-in-device/189694>\
**Category:** Ionic Framework\
**Created:** [May 19, 2020, 11:05am UTC](https://forum.ionicframework.com/t/test-web-api-works-on-ionic-lab-and-emulator-but-not-in-device/189694 "2020-05-19T11:05:10Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ManelHK](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/manelhk/32/132389_2.png) [@ManelHK](https://forum.ionicframework.com/u/ManelHK)\
**Post date:** [May 19, 2020, 1:21pm UTC](https://forum.ionicframework.com/t/test-web-api-works-on-ionic-lab-and-emulator-but-not-in-device/189694/6 "2020-05-19T13:21:17Z")

</div>

The solution was to add

> [https://cors-anywhere.herokuapp.com/](https://cors-anywhere.herokuapp.com/)  
> before the url of the hostsitename.  
> so will be like this:

```auto
 var _url="https://cors-anywhere.herokuapp.com/http://hostnamesite.com/api/APILogin";

```

I get the solution from this link:  
[https://forum.ionicframework.com/t/ionic3-http-call-android-9-0-4/160872](https://forum.ionicframework.com/t/ionic3-http-call-android-9-0-4/160872)

---

_[View the full topic](https://forum.ionicframework.com/t/test-web-api-works-on-ionic-lab-and-emulator-but-not-in-device/189694)._
