# Ionic 1 AngularJS HTTP post vs. Ionic 3 Angular HTTP post

**URL:** <https://forum.ionicframework.com/t/ionic-1-angularjs-http-post-vs-ionic-3-angular-http-post/110424>\
**Category:** ionic-v3\
**Created:** [October 30, 2017, 9:07am UTC](https://forum.ionicframework.com/t/ionic-1-angularjs-http-post-vs-ionic-3-angular-http-post/110424 "2017-10-30T09:07:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivsuthanm](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shivsuthanm/32/103030_2.png) [@shivsuthanm](https://forum.ionicframework.com/u/shivsuthanm)\
**Post date:** [October 30, 2017, 9:07am UTC](https://forum.ionicframework.com/t/ionic-1-angularjs-http-post-vs-ionic-3-angular-http-post/110424/1 "2017-10-30T09:07:13Z")

</div>

I was worked much in the combination of Ionic 1 AngularJS, but after entering into the trend Ionic 3 Angular faced some issues in simple HTTP post request itself.

Let me explain the scenario please find below.

> app.module.ts

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

```

> login.ts

```auto
import {Http, Headers, RequestOptions} from '@angular/http';
    
    let link = 'http://demo.mydomain.com/myservice/login';
    
    var headers = new Headers();
    headers.append("Accept", 'application/json');
    headers.append('Content-Type', 'application/x-www-form-urlencoded');
    headers.append('Access-Control-Allow-Origin', 'http://localhost');
    headers.append('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
    headers.append('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
    headers.append('Access-Control-Allow-Credentials', 'true');
    
    let options = new RequestOptions({headers: headers});
    
    let postParams = JSON.stringify({"password":this.passCode, "userName":this.userName});
    
    this.http.post(link, postParams, options)
    .subscribe(data => {
        alert("data");
    }, error => {
        alert("error");
    });

```

While running out in the browser using ionic serve getting below response.

> Failed to load [http://demo.mydomain.com/myservice/login:](http://demo.mydomain.com/myservice/login:) No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘[http://localhost:8105](http://localhost:8105)’ is therefore not allowed access. The response had HTTP status code 400.

As per my understanding if it’s CORS based issues after installed the Chrome CORS plugin as well getting same issues.

Even I tried the direct running for the Android phone using `ionic cordova run android that’s too getting error block.
