| Issue 15: | Look for JSON in other content types | |
| 14 people starred this issue and may be notified of changes. | Back to list |
Would be nice to be able support multiple content types, maybe a user list where you can add the types you want the parser to handle. |
|
,
Mar 30, 2009
Some other content types than "application/json" are quite popular (though not correct). I can often see "application/javascript" and "application/x-javascript" for example. So an option that would enable JSONView for given content types would be cool. Or maybe a context menu option like "View as JSON". |
|
,
Apr 21, 2009
Can you give some examples of products which produce JSON with incorrect content types (that can't be easily configured to serve it correctly)? |
|
,
Apr 24, 2009
I've also encountered a third-party product that responds as 'text/javascript;charset=utf-8'. It would be nice if there were a way to try and force a page's contents to render as JSON, regardless of the mimetype. |
|
,
Apr 24, 2009
Ben, from popular ones, Google uses "text/javascript" in their APIs as well as Facebook. And they surely can't be easily configured to use "text/json". Lots of others also use incorrect content types. |
|
,
Apr 27, 2009
excieve, can you point me to specific examples? I looked at http://code.google.com/apis/gdata/json.html, which pointed me at http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json which is served as application/json. Facebook's APIs appear to actually serve JavaScript, not JSON (the "for (;;);" guard they put on it actually makes it not be real JSON, though I could see adapting JSONView to specifically handle that). |
|
,
Apr 27, 2009
(No comment was entered for this change.)
Summary: Look for JSON in other content types
|
|
,
Apr 27, 2009
Issue 12 has been merged into this issue. |
|
,
May 28, 2009
Issue 25 has been merged into this issue. |
|
,
Jun 16, 2009
The format I'm working with is specified at http://www.w3.org/TR/rdf-sparql-json-res/ and relies on the "application/sparql-results+json" content type. All we need is a simple UI that allows the configuration of supported content types. |
|
,
Jun 30, 2009
Issue 28 has been merged into this issue. |
|
,
Jun 30, 2009
Admittedly I'm close to clueless about Firefox's API, but anything I can research to try and help fix this or do you have an idea of a fix? |
|
,
Jul 01, 2009
I have ideas of how to properly fix this, but I mostly need time. |
|
,
Aug 05, 2009
(No comment was entered for this change.)
Status: Accepted
Labels: -Priority-Low Priority-High |
|
,
Oct 08, 2009
just tried to enable nsIURIContentListener, but it's simply ignoring the interface mappings. Will have to read manuals. it's a pain to work out all the XPCOM versions. Another option, to not depend on server mimetypes, is to use nsIContentSniffer to detect JSON patterns. |
|
,
Oct 15, 2009
FYI Per the spec, the correct mime type is actually application/jsonrequest. http://www.json.org/JSONRequest.html |
|
,
Oct 15, 2009
jauderho, the correct mime type is "application/json". You're referring to the JSONRequest cross-domain JSON proposal, which to my knowledge has not been implemented in any browser. |
|
,
Dec 05, 2009
From the book "CouchDB. The Definitive Guide": < Content-Type: text/plain;charset=utf-8 This header tells you which mime type the HTTP response body is and its encoding. We already know CouchDB returns JSON strings. The appropriate Content-Type header is application/json. Why do we see text/plain? This is where pragmatism wins over purity. Sending an application/json Content-Type header will make a browser offer you the returned JSON for download instead of just displaying it. Since it is extremely useful to be able to test CouchDB from a browser, CouchDB sends a text/plain content type, so all browser will display the JSON as text. |
|
,
Dec 05, 2009
Hi joanllosas, JSONView works great with CouchDB - see http://benhollis.net/blog/2009/10/12/jsonview-0-4-with-content-negotiation/ for details. You have to enable sending "application/json" in your Accept header, and then it'll display correctly. |
|
|
|