Moodle
  1. Moodle
  2. MDL-29913

REST server should also return JSONP objects

    Details

    • Rank (Obsolete):
      19492

      Description

      We should add some JSONP support to the REST server. It would be useful to do cross-platform call in javascript.

        Activity

        Hide
        Juan Leyva added a comment -

        I think this is a required feature for developing HTML5 webservice clients

        For the readers: Please note that this is not required if you package your app with Phonegap or other frameworks.

        See: http://wiki.phonegap.com/w/page/16494770/FAQ (AJAX question)..

        Q. I want to create an application for phonegap to access externally deployed web services via AJAX. How can i resolve the issue with the
        cross-domain security policy of XmlHttpRequest?
        A. The cross-domain security policy does not affect PhoneGap applications. Since the html files are called by webkit with the file:// protocol, the security policy does not apply.
        (in Android,you may grant android.permission.INTERNET to your app by edit the AndroidManifest.xml)

        Show
        Juan Leyva added a comment - I think this is a required feature for developing HTML5 webservice clients For the readers: Please note that this is not required if you package your app with Phonegap or other frameworks. See: http://wiki.phonegap.com/w/page/16494770/FAQ (AJAX question).. Q. I want to create an application for phonegap to access externally deployed web services via AJAX. How can i resolve the issue with the cross-domain security policy of XmlHttpRequest? A. The cross-domain security policy does not affect PhoneGap applications. Since the html files are called by webkit with the file:// protocol, the security policy does not apply. (in Android,you may grant android.permission.INTERNET to your app by edit the AndroidManifest.xml)
        Hide
        Jérôme Mouneyrac added a comment - - edited

        The github submission I attached was created for testing a Moodle HTML5 ws client prototype. It could need a bit of polishing, but it should not be far from final version.

        Show
        Jérôme Mouneyrac added a comment - - edited The github submission I attached was created for testing a Moodle HTML5 ws client prototype. It could need a bit of polishing, but it should not be far from final version.
        Hide
        Nathan Mares added a comment -

        I have to agree, this would be a useful addition to Moodle's web services.

        Jerome - github submissions looks good but shouldn't the Content-Type be "application/javascript" for the jsonp content type?

        Show
        Nathan Mares added a comment - I have to agree, this would be a useful addition to Moodle's web services. Jerome - github submissions looks good but shouldn't the Content-Type be "application/javascript" for the jsonp content type?
        Hide
        Jérôme Mouneyrac added a comment -

        Hi Nathan, I don't know, I didn't ask myself this question as token.php already return json and it worked like that. But it's a good remark.

        Show
        Jérôme Mouneyrac added a comment - Hi Nathan, I don't know, I didn't ask myself this question as token.php already return json and it worked like that. But it's a good remark.
        Hide
        Jérôme Mouneyrac added a comment -

        I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
        For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        Show
        Jérôme Mouneyrac added a comment - I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: