# $http request not working

**URL:** <https://forum.ionicframework.com/t/http-request-not-working/40989>\
**Category:** ionic-v1\
**Created:** [January 11, 2016, 7:50pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989 "2016-01-11T19:50:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eranfl](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eranfl](https://forum.ionicframework.com/u/eranfl)\
**Post date:** [January 11, 2016, 7:50pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/1 "2016-01-11T19:50:47Z")

</div>

Hi,

I’m new to ionic but I love the framework.  
I’m trying to create an app and I’m using the Yahoo! finance API to receive some data.  
I’m using the angular $http.get method and everything works great when I test it on my browser.  
When I test it on android virtual environment or on my real phone, the app stuck after the $http.get request and doesn’t return a promise…

I guess it has something to do with ionic or maybe I’m missing something?

Thank!

---

<div class="post-metadata">

**Author:** ![Destroy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/destroy/32/94194_2.png) [@Destroy](https://forum.ionicframework.com/u/Destroy)\
**Post date:** [January 12, 2016, 8:28am UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/2 "2016-01-12T08:28:57Z")

</div>

Hi,

Can you share your code?

---

<div class="post-metadata">

**Author:** ![eranfl](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eranfl](https://forum.ionicframework.com/u/eranfl)\
**Post date:** [January 12, 2016, 10:33pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/3 "2016-01-12T22:33:30Z")

</div>

Hi,

Sure, I’m just trying to call a async call using the yahoo finance api

```
$http.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22USDEUR%22%29&env=store://datatables.org/alltableswithkeys&format=json")
    .then(function(data) {
       
        $scope.currencyResult = data.data.query.results.rate.Rate;                       
    });

```

For some reason when I try to build the apk using the ionic command, I receive an error, so I used the phonegap command and the build worked. Is it has something to do with that?

Thanks

---

<div class="post-metadata">

**Author:** ![Destroy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/destroy/32/94194_2.png) [@Destroy](https://forum.ionicframework.com/u/Destroy)\
**Post date:** [January 13, 2016, 10:18pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/4 "2016-01-13T22:18:41Z")

</div>

This is very strange.  
It should be work.  
What is the error?

---

<div class="post-metadata">

**Author:** ![eranfl](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eranfl](https://forum.ionicframework.com/u/eranfl)\
**Post date:** [January 13, 2016, 11:00pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/5 "2016-01-13T23:00:35Z")

</div>

I thought so too…  
I receive 404 error

I copied the error details:

![image](https://global.discourse-cdn.com/ionicframework/original/3X/0/4/04876b2b265a152ea7344cfffb9d4aa7fded3a0a.PNG)

thanks

---

<div class="post-metadata">

**Author:** ![Destroy](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/destroy/32/94194_2.png) [@Destroy](https://forum.ionicframework.com/u/Destroy)\
**Post date:** [January 14, 2016, 10:12am UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/6 "2016-01-14T10:12:10Z")

</div>

Just for testing purposes can you try with this: [http://codepen.io/Vatsov/pen/WrEavb](http://codepen.io/Vatsov/pen/WrEavb)

---

<div class="post-metadata">

**Author:** ![eranfl](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eranfl](https://forum.ionicframework.com/u/eranfl)\
**Post date:** [January 15, 2016, 11:56pm UTC](https://forum.ionicframework.com/t/http-request-not-working/40989/7 "2016-01-15T23:56:20Z")

</div>

Hi,

I figured it out… just needed to add the cordova whitelist plugin (in cordova/phonegap its added by default)

> **[Ionic Services Docs](http://legacy-cloud-docs.ionic.io)**
>
> Documentation for the Ionic Services Service: Push, Users, Package, and Deploy

Thanks
