# Https post not working on iOS

**URL:** <https://forum.ionicframework.com/t/https-post-not-working-on-ios/107980>\
**Category:** ionic-v3\
**Created:** [October 6, 2017, 8:39pm UTC](https://forum.ionicframework.com/t/https-post-not-working-on-ios/107980 "2017-10-06T20:39:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaun2344](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shaun2344](https://forum.ionicframework.com/u/shaun2344)\
**Post date:** [October 6, 2017, 8:39pm UTC](https://forum.ionicframework.com/t/https-post-not-working-on-ios/107980/1 "2017-10-06T20:39:32Z")

</div>

Hi,

I am using the following code to send a post request to my API which is working fine within the browser (with CORS disabled) and on a native Android build. However the same code built for iOS doesn’t work. The code is below:

```auto
return new Promise((resolve, reject) => {
      this.http.post(this.apiUrl+'/login/', data)
        .subscribe(res => {
          resolve(res);
        }, (err) => {
          reject(err);
        });
    });

```

The output I see within Xcode when running the app is:

```auto
{"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":null,"ok":false,"name":"HttpErrorResponse","message":"Http failure response for (unknown url): 0 Unknown Error","error":{"isTrusted":true}}

```

If I load my app via phone gap on iOS the API calls work fine, but fail when built via xcode and also when running via ionic view.

---

<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:** [October 6, 2017, 9:42pm UTC](https://forum.ionicframework.com/t/https-post-not-working-on-ios/107980/2 "2017-10-06T21:42:34Z")

</div>

There is no point in explicitly instantiating a `Promise` in this situation.

---

<div class="post-metadata">

**Author:** ![amarewgs](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@amarewgs](https://forum.ionicframework.com/u/amarewgs)\
**Post date:** [December 2, 2017, 1:45pm UTC](https://forum.ionicframework.com/t/https-post-not-working-on-ios/107980/3 "2017-12-02T13:45:23Z")

</div>

same here, works on android build and browser but never work on ios. any fix on this?
