• We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      The problem:

      When you use JSONP to access the REST-API you can't set the access header. And therefore Confluence returns the default XML document, witch can't be read by javascript when you do cross origin requests.

      How to reproduce the problem:

      1. open the attached confluenceRestFail.html file
      2. open the javascript console on you web browser
      3. see the error message because it can't interpret the "<" in the beginning of the XML document it gets back.

      Suggested fix:

      Confluence could use the jsonp-callback= GET parameter to set the return type to JSON instead of XML. Because the jsonp-callback= parameter is pretty useless for a xml request...

      Why you can't set the Accept header in javascript when using JSONP

      You can't set the access header because when you use JSONP the tool of you choice creates a <script> element and sets the "src" attribute to the URL you want. And you can't set a Accept: "application/json" on a <script> element. Therefore your Accept headers looks like this: Accept: */* and that in turn results in confluence returning XML.

            [CONFSERVER-31192] The REST-API should work with javascript (JSONP)

            Sen Geronimo made changes -
            Workflow Original: JAC Suggestion Workflow 4 [ 3572237 ] New: JAC Suggestion Workflow 3 [ 4334887 ]
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow 2 [ 3182305 ] New: JAC Suggestion Workflow 4 [ 3572237 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3024250 ] New: JAC Suggestion Workflow 2 [ 3182305 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing v4 [ 2531440 ] New: JAC Suggestion Workflow [ 3024250 ]
            Rachel Lin (Inactive) made changes -
            Workflow Original: Confluence Workflow - Public Facing v3 [ 2277353 ] New: Confluence Workflow - Public Facing v4 [ 2531440 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing v3 - TEMP [ 2155725 ] New: Confluence Workflow - Public Facing v3 [ 2277353 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing v3 [ 1938392 ] New: Confluence Workflow - Public Facing v3 - TEMP [ 2155725 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing v2 [ 1754788 ] New: Confluence Workflow - Public Facing v3 [ 1938392 ]
            jonah (Inactive) made changes -
            Description Original: h4. The problem:
            When you use JSONP to access the REST-API you can't set the access header. And therefore Confluence returns the default XML document, witch can't be read by javascript when you do cross origin requests.

            h4. How to reproduce the problem:
            # open the attached [^confluenceRestFail.html] file
            # open the javascript console on you web browser
            # see the error message because it can't interpret the "<" in the beginning of the XML document it gets back.

            h4. Suggested fix:
            Confluence could use the jsonp-callback= GET parameter to set the return type to JSON instead of XML. Because the jsonp-callback= parameter is pretty useless for a xml request...

            h4. Why you can't set the Accept header in javascript when using JSONP
            You can't set the access header because when you use JSONP the tool of you choice creates a <script> element and sets the "src" attribute to the URL you want. And you can't set a Accept: "application/json" on a <script> element. Therefore your Accept headers looks like this: Accept: \*/\* and that in turn results in confluence returning XML.
            New: {panel:bgColor=#e7f4fa}
              *NOTE:* This suggestion is for *Confluence Server*. Using *Confluence Cloud*? [See the corresponding suggestion|http://jira.atlassian.com/browse/CONFCLOUD-31192].
              {panel}

            h4. The problem:
            When you use JSONP to access the REST-API you can't set the access header. And therefore Confluence returns the default XML document, witch can't be read by javascript when you do cross origin requests.

            h4. How to reproduce the problem:
            # open the attached [^confluenceRestFail.html] file
            # open the javascript console on you web browser
            # see the error message because it can't interpret the "<" in the beginning of the XML document it gets back.

            h4. Suggested fix:
            Confluence could use the jsonp-callback= GET parameter to set the return type to JSON instead of XML. Because the jsonp-callback= parameter is pretty useless for a xml request...

            h4. Why you can't set the Accept header in javascript when using JSONP
            You can't set the access header because when you use JSONP the tool of you choice creates a <script> element and sets the "src" attribute to the URL you want. And you can't set a Accept: "application/json" on a <script> element. Therefore your Accept headers looks like this: Accept: \*/\* and that in turn results in confluence returning XML.
            jonah (Inactive) made changes -
            Link New: This issue relates to CONFCLOUD-31192 [ CONFCLOUD-31192 ]

              Unassigned Unassigned
              f91bc6109242 Karl Gustav
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: