# $http question

**URL:** <https://forum.ionicframework.com/t/http-question/51986>\
**Category:** ionic-v1\
**Created:** [May 13, 2016, 3:59pm UTC](https://forum.ionicframework.com/t/http-question/51986 "2016-05-13T15:59:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raeon](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@raeon](https://forum.ionicframework.com/u/raeon)\
**Post date:** [May 13, 2016, 3:59pm UTC](https://forum.ionicframework.com/t/http-question/51986/1 "2016-05-13T15:59:32Z")

</div>

Hi,  
I’m building an Ionic project.  
I can’t understand the logic of $http in ionic run Android:  
I build my application on android, and there isn’t the concept of server side or client side(browser).  
If I use $http in order to read a local JSON file, what it will do really?  
If I want to create a local json file, it will be better to read it with $Http function or try to read directly the file json ?

Is there a way with angular js or javascript read directly the local file json?

Thanks in adavce

---

<div class="post-metadata">

**Author:** ![mgochoa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mgochoa/32/100476_2.png) [@mgochoa](https://forum.ionicframework.com/u/mgochoa)\
**Post date:** [May 14, 2016, 7:53am UTC](https://forum.ionicframework.com/t/http-question/51986/2 "2016-05-14T07:53:21Z")

</div>

Based on angular docs : [https://docs.angularjs.org/api/ng/service/$http](https://docs.angularjs.org/api/ng/service/%24http)

_The $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser’s XMLHttpRequest object or via JSONP._

But it allows you also calling local files, because they are going to return the same data that a server would return.

So according to this: [http://stackoverflow.com/questions/16930473/angularjs-factory-http-get-json-file](http://stackoverflow.com/questions/16930473/angularjs-factory-http-get-json-file)  
You can try this.

```javascript
var mainInfo = $http.get('path_to_json_file').success(function(response) {
        return response.data;
    });
}])

```

Just remember that you have to call the `$http` dependency wherever you’re calling this piece of code.

I hope this will be helpful for you.
