# JSON API content type makes exploring in the browser impossible

**URL:** <https://discuss.jsonapi.org/t/json-api-content-type-makes-exploring-in-the-browser-impossible/461>\
**Category:** Uncategorized\
**Created:** [May 13, 2016, 9:29am UTC](https://discuss.jsonapi.org/t/json-api-content-type-makes-exploring-in-the-browser-impossible/461 "2016-05-13T09:29:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casey](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/casey/32/336_2.png) [@casey](https://discuss.jsonapi.org/u/casey)\
**Post date:** [May 13, 2016, 9:29am UTC](https://discuss.jsonapi.org/t/json-api-content-type-makes-exploring-in-the-browser-impossible/461/1 "2016-05-13T09:29:58Z")

</div>

Since JSON API uses a custom content type, the result is you can’t just view a json api response in the browser. On Firefox on Linux at least, it prompts you to download the response body.

Perhaps setting Content-Disposition to inline would work?

Has anyone seen this before? What’s the workaround? I can’t be the first to discover this.

Edit: After some testing it appears Firefox and Safari are the only ones that download the response. Chrome and Opera display it as text.

---

<div class="post-metadata">

**Author:** ![ef4](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/ef4/32/215_2.png) [@ef4](https://discuss.jsonapi.org/u/ef4)\
**Post date:** [May 16, 2016, 9:11pm UTC](https://discuss.jsonapi.org/t/json-api-content-type-makes-exploring-in-the-browser-impossible/461/2 "2016-05-16T21:11:45Z")

</div>

I would suggest using a tool that is made for exploring APIs. For example, [Advanced REST Client](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo/reviews?hl=en-US&utm_source=ARC) is easy to install and [open source](https://github.com/jarrodek/ChromeRestClient).

---

<div class="post-metadata">

**Author:** ![tkellen](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/tkellen/32/1_2.png) [@tkellen](https://discuss.jsonapi.org/u/tkellen)\
**Post date:** [May 20, 2016, 1:18pm UTC](https://discuss.jsonapi.org/t/json-api-content-type-makes-exploring-in-the-browser-impossible/461/3 "2016-05-20T13:18:33Z")

</div>

While it is true that no browser explicitly sends an Accepts header for our media type, it is **not** true that this should prevent viewing in a browser. It sounds like the implementation you’re using could be handling content negotiation more effectively. Basically, absent the client saying hey, I want an `application/vnd.api+json` representation of your resource, the server should send a `text/plain` or `text/html` representation. An API is no different than a website.

More information here:  
[https://tools.ietf.org/html/rfc7231#section-5.3.2](https://tools.ietf.org/html/rfc7231#section-5.3.2)

> **[Content negotiation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation)**
>
> In HTTP, content negotiation is the mechanism that is used for serving different representations of a resource at the same URI, so that the user agent can specify which is best suited for the user (for example, which language of a document, which...
