I would like to open "application/hal+json" response inline in my Chrome browser. The problem is that the Chrome browser doesn't recognize the HAL response and downloads it. Before I always used the JSON view extension for Chrome for checking my JSON response. But since swapping to HAL it immediately downloads my response so I cannot review it anymore.
-
1You can participate on resolving the issue for JSONView: https://github.com/bhollis/jsonview/issues/7 – Honza Javorek Feb 05 '14 at 16:51
3 Answers
For Chrome: I just ran into a nice solution myself. I hope answering here will help some other people who run into the same problem... Installing this 'application/...+json|+xml as inline' chrome extension solved it nicely. I am now able to review my server response again as normal.
For FireFox:
Install the extension called JSONView. After install go to extensions page (default: ctrl
+shift
+a
) find the JSONView extension and go to options. There you can add "Alternate JSON content types" that should be opened as by the extension. Simply add application/hal+json
to the input field and it will work:
REST developer add-ons: Another solution can be to install a REST developer add-on. The advantage is that you can also change the http request verb (POST, GET, PATCH, PUT, DELETE) and custom set your request headers. A great REST plugin for Chrome is POSTMAN and a nice one for FireFox is RESTClient. But there are several other ones available.

- 41,477
- 12
- 152
- 203
-
4
-
Also, I'm not so sure this even does anything. Chrome is downloading a file when I select the "preview" tab with application/hal+json, this plugin doesn't rectify that for me. – creamcheese Jan 28 '14 at 19:52
-
1**FOR FIREFOX** @acohen it's probably too late, but for someone who looking for answer, here's solution: download extension [JSONView](http://jsonview.com/), after install go to extensions page (default: ctrl+shift+a) find on list JSONView and go to options of this extension. And under rates and reviews there is option "Include "application/json" in the HTTP Accept header for request." **enable it**. After this I can open app/json in firefox ;) – miljon Aug 28 '15 at 01:17
-
@mij, thanks for your answer. I changed it a bit and added it. There is an *"Alternate JSON content types"* field as well in the options panel you mentioned. This seems better since it will not change any of your outgoing requests. – Wilt Aug 28 '15 at 07:25
This doesn't exactly answer your question, but installing the HAL Browser from your web server will convert HAL to HTML for viewing your application/hal+json responses inline. It's particularly nice because it makes the links navigable and also links to the relation documentation (if the relation name is a URI).
Oddly enough, my Chrome sends an Accept header of /;q=0.8 so it falls back to anything the server sends it. I wonder if you're running a different version of Chrome than I am. I'm on v30.0.1599.101.

- 3,759
- 19
- 20
-
Can you point to some useful link/resources which can guide for how to install HAL browser ? Thanks – Aman Gupta Apr 30 '14 at 05:27
-
The code is on GitHub [here](https://github.com/mikekelly/hal-browser). The README explains how to install: drop the files into the root directory (or a subdirectory) of your web server. – Jonathan W Apr 30 '14 at 11:30
-
Thanks Jonathan, I did exactly the same way, copy pasted every files and directory to webapps.. but still no luck.. – Aman Gupta Apr 30 '14 at 13:43
Came here looking for a solution for Firefox and application/hal+json
content type.
I ended up installing JSONView, which has an option in its preferences menu to add extra content types.

- 5,347
- 2
- 30
- 47