# @ionic-native/http - post error Content-Type body Json

**URL:** <https://forum.ionicframework.com/t/ionic-native-http-post-error-content-type-body-json/96479>\
**Category:** Ionic Native\
**Created:** [June 30, 2017, 6:31pm UTC](https://forum.ionicframework.com/t/ionic-native-http-post-error-content-type-body-json/96479 "2017-06-30T18:31:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![moisesvni](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@moisesvni](https://forum.ionicframework.com/u/moisesvni)\
**Post date:** [June 30, 2017, 6:31pm UTC](https://forum.ionicframework.com/t/ionic-native-http-post-error-content-type-body-json/96479/1 "2017-06-30T18:31:13Z")

</div>

What am I doing wrong with the post to convert the body to json?

Import my file .ts

```auto
import { HTTP } from '@ionic-native/http';

```

Creation arguments for http post

```auto
var url = "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/12d9fbb9-0914-441f-9c1b-8076630f0522/message?version=2017-05-26";

var body = { "alternate_intents": false, "input": { "text": "cerveja" } };
this.http.useBasicAuth("juca", "1234567");
this.http.setHeader('Accept', 'application/json');
this.http.setHeader('Content-Type', 'application/json');

```

```auto
this.http.post(url, body, {})
      .then(data => {
        console.log(data.data); // data received by server
      })
      .catch(error => {
        console.log(error.error); // error message as string
      });

```

I tried to use the new FormData(), but server does not understand value for body

```auto
 let bodys = new FormData();
 var input = "{'text': 'cerveja'}";
 bodys.append('alternate_intents', 'false');  
 bodys.append('input', input);

```

---

<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:** [June 30, 2017, 7:46pm UTC](https://forum.ionicframework.com/t/ionic-native-http-post-error-content-type-body-json/96479/2 "2017-06-30T19:46:02Z")

</div>

Why aren’t you using the ordinary Angular `Http`?

---

<div class="post-metadata">

**Author:** ![Kanishk12](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kanishk12](https://forum.ionicframework.com/u/Kanishk12)\
**Post date:** [January 8, 2018, 1:38pm UTC](https://forum.ionicframework.com/t/ionic-native-http-post-error-content-type-body-json/96479/4 "2018-01-08T13:38:54Z")

</div>

Hi @moisesvni, did you solve this issue ? I’m facing the same kind of problem while posting FormData type object using ionic native HTTP

Thanks
