Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

jquery ajax call for REST api not working giving error

$
0
0

I am trying to call rest api using this codes response is  coming in error.

It should be in success. Can somebody help me on this. if u hit the url in browser you will get the response in a json structure.

 

var url = 'http://54.217.223.37:8000/sap/bc/ztest_specific?sap-client=998'; 

        $.ajax({

                     contentType: 'application/json; charset=utf-8',

                     url: url, 

                     type: "GET",

                      jsonpCallback: 'processJSON',

                     dataType:'jsonp',

                     data:{'_CUST':'0000001000'},

                      async : false,

                      headers:{

                                     'Authorization':'Basic ZGRpYzpzYXA0Y250YQ=='

                         },

                     success: function (result) { 

                                    alert('s');

                                    console.log(result.text);    

                             },

                      error: function (aaa) { 

                        // log error in browser 

                        alert('e');

                       console.log(aaa); 

                      }

    });


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>