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

UI5 JSON service authentication

$
0
0

Hello,

I am calling a JSON service in UI5,which requires authentication.I have used the below code,but it doesnot work,can you provide some help in resolving the issue.

 

var aData = 

          jQuery.ajax({

 

 

             url: "http://erpapi07.transport.nsw.gov.au:8001/sap/eammob?sap-client=910", 

             dataType: "json",

             xhrFields:

                 {

                     withCredentials: true

                 },

             beforeSend: function(xhr) {

                 xhr.setRequestHeader("Authorization", "Basic " + btoa(USERID + ":" + PASSWORD));

             },

             success: function(data, textStatus, jqXHR) { // callback called when data is received

                alert("sparta");

             },

 

 

             error: function(jqXHR, textStatus, errorThrown) {

 

 

            

               alert(jqXHR);

                   alert(textStatus);

                   alert(errorThrown);

 

 

             }

 

 

          });

 

Regards

Kaushik


Viewing all articles
Browse latest Browse all 8501

Trending Articles



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