1. #1
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    13
    Vote Rating
    0
    rgendler is on a distinguished road

      0  

    Default Content type "application/x-json" in HTTP response

    Hi,

    I've noticed in the Ext4.* API documentation for the JSON proxy, in the server side example that the content type is explicitly set to "application/x-json" . What is the significance of that? Example is listed here: http://docs.sencha.com/ext-js/4-0/#/...ta.proxy.JsonP

    It seems that the official JSON specific content type is "application/json". I don't quite understand the difference and if the difference significant at all.

    We are using Jackson JSON processor on the server side. Jackson does not support "application/x-json"
    It only supports recognized content types listed in javax.ws.rs.core.MediaType from JAX-RS lib

    At the moment I have a problem reading the data frm ExtJS JsonP proxy returned by Jackson processor and wondering if the difference in content types is the cause of it.

    Did anybody faced a similar issue ?

    Thank you very much.

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Location
    Queensland, Australia
    Posts
    17
    Vote Rating
    1
    gaellafond is on a distinguished road

      0  

    Default Any answer?

    Did you found why?

    I wonder the same. I'm using "application/json" because it seems to be the standard, but the ExtJS examples are using "application/x-json"... I'm sure there is a good reason, but unless I found it I will continue to use "application/json".

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    72
    Vote Rating
    13
    eric.cook will become famous soon enough

      0  

    Default

    Quote Originally Posted by gaellafond View Post
    I'm sure there is a good reason
    Not necessarily. I found the server-side JsonP examples in the Ext JS 3.2.1 ScriptTagProxy docs. It's probably just outdated code.

    In almost all cases, "application/json" should be used when returning JSON content.