Calling Worklight adapter from external app

后端 未结 2 1877
离开以前
离开以前 2020-12-19 22:33

I have deployed the adapter on Worklight server and there is some requirement where I am calling worklight adapter from outside as a rest serverice , it is working fine and

相关标签:
2条回答
  • 2020-12-19 22:45

    remove /dev/ component from the URL, it is for development ease purposes only. without it you'll get your JSON.

    0 讨论(0)
  • 2020-12-19 22:58

    I had the same issue and after reading Anton's answers I set the "dataType" of the Ajax call to "text" and then edit the response to remove the /*-secure- and */ and then parsed the string to get the JSON "JSON.parse(theString)"

    $.ajax({
                type: 'POST',
                url: ajaxURL,               
                async: true,
                cache: true,
                timeout: 5,
                dataType: "text",
                success: function(data){                    
                    data = data.replace("/*-secure-","");
                    data = data.replace("*/","");                   
                    var dataJSON = JSON.parse(data);                    
                    //Do success                
                },
                error: function(data, statusCode){
                    //Do error                  
                }
            });
    
    0 讨论(0)
提交回复
热议问题