# Http in Ionic 3.0.1

**URL:** <https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292>\
**Category:** tutorials\
**Created:** [April 21, 2017, 3:53am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292 "2017-04-21T03:53:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanlogsdon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ryanlogsdon/32/103208_2.png) [@ryanlogsdon](https://forum.ionicframework.com/u/ryanlogsdon)\
**Post date:** [April 21, 2017, 3:53am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/1 "2017-04-21T03:53:14Z")

</div>

Hi All,

Since there’s no tutorial yet on the breaking changes affecting Ionic v3’s use of angular/http, I hope this will help anyone with the following errors:

`HttpModule is not defined`  
or  
`Uncaught (in promise): Error: No provider for Http!`

Here are the changes you need to make to use native Http in Ionic v3…

**app.module.ts**

```auto
import { HttpModule } from '@angular/http';
...
@NgModule({
    ...
    imports: [
        BrowserModule,
        HttpModule,
        IonicModule.forRoot(MyApp),
    ],
...

```

**MyPage.ts**

```auto
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/timeout';
...
constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http) {
    }
...

ETPhoneHome() {
        let path = 'http://localhost:8080/foo';
        let encodedPath = encodeURI(path);
        let timeoutMS = 10000;

        this.http.get(encodedPath)
            .timeout(timeoutMS)
            .map(res => res.json()).subscribe(data => {
                let responseData = data;
                console.log(responseData);
            },
            err => {
                console.log('error in ETPhoneHome');
            });
    }

```

And that’s it!

Thanks,  
Ryan

---

<div class="post-metadata">

**Author:** ![SigmundFroyd](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sigmundfroyd/32/111604_2.png) [@SigmundFroyd](https://forum.ionicframework.com/u/SigmundFroyd)\
**Post date:** [April 21, 2017, 4:00am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/2 "2017-04-21T04:00:25Z")

</div>

It’s good to clarify this, however I feel it’s important to point out that this info is also in the Ionic 3.0.0 [changelog](https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#300-2017-04-05).

---

<div class="post-metadata">

**Author:** ![ryanlogsdon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ryanlogsdon/32/103208_2.png) [@ryanlogsdon](https://forum.ionicframework.com/u/ryanlogsdon)\
**Post date:** [April 21, 2017, 4:13am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/3 "2017-04-21T04:13:28Z")

</div>

How about that! 🙂  
Well considering how many people are having trouble with it, and the lack of a tutorial…

Thanks for the changelog link. 🙂

---

<div class="post-metadata">

**Author:** ![SigmundFroyd](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sigmundfroyd/32/111604_2.png) [@SigmundFroyd](https://forum.ionicframework.com/u/SigmundFroyd)\
**Post date:** [April 21, 2017, 4:16am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/4 "2017-04-21T04:16:14Z")

</div>

Certainly! I didn’t mean to disparage your contribution. I just thought it’d be worthwhile to point to the changelog for future reference when it comes to new releases.

---

<div class="post-metadata">

**Author:** ![malignois](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@malignois](https://forum.ionicframework.com/u/malignois)\
**Post date:** [September 3, 2017, 10:09am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/5 "2017-09-03T10:09:34Z")

</div>

Hi @ryanlogsdon,

I tried to use your example but I am facing this error :

Property ‘timeout’ does not exist on type ‘Observable’

Do you have an idea of the cause ?

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [September 4, 2017, 3:25am UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/6 "2017-09-04T03:25:21Z")

</div>

> [@malignois](#):
>
> Property ‘timeout’ does not exist on type ‘Observable’

Probably an artifact of how you are importing `Observable`. An additional import for `timeout` may be needed.

---

<div class="post-metadata">

**Author:** ![bamboon](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bamboon](https://forum.ionicframework.com/u/bamboon)\
**Post date:** [January 29, 2018, 3:21pm UTC](https://forum.ionicframework.com/t/http-in-ionic-3-0-1/87292/7 "2018-01-29T15:21:24Z")

</div>

> [@ryanlogsdon](#):
>
> import { Http } from ‘@angular/http’;

thanks alot ! it solved my problem.
