# API request returns text/html and not a json object

**URL:** <https://meta.discourse.org/t/api-request-returns-text-html-and-not-a-json-object/237407>\
**Category:** Support\
**Created:** [August 28, 2022, 8:42pm UTC](https://meta.discourse.org/t/api-request-returns-text-html-and-not-a-json-object/237407 "2022-08-28T20:42:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [August 28, 2022, 10:02pm UTC](https://meta.discourse.org/t/api-request-returns-text-html-and-not-a-json-object/237407/2 "2022-08-28T22:02:53Z")

</div>

> [@hiddenseal](#):
>
> So what am I doing wrong?

You have a duplicate header:

> [@hiddenseal](#):
>
> ```plaintext
> headers["Content-Type"] = "multipart/form-data"
> headers["Content-Type"] = "application/json"
> 
> ```

`Content-Type` is about what you send, and `Accept` is about what you want in return.  
So you’ll need to change this to

```plaintext
headers["Content-Type"] = "multipart/form-data"
headers["Accept"] = "application/json"

```

---

_[View the full topic](https://meta.discourse.org/t/api-request-returns-text-html-and-not-a-json-object/237407)._
