how can call web api mobile jquery, using in eclipse phone gap project. error when call web api. web api in made in asp.net mvc 4 & deployed in azure api management.
to call require set header, have set these still executes error loop following code:
<script type="text/javascript"> var commonurl = "https://mydo.azureapi.net/tcp_test/api/controllername/"; function getcoachprofile(userid,at) { alert('2'); $.ajax({ url: commonurl + 'getuserprofile?userid=' + userid + '&authtoken=' + at, type: 'get', contenttype: 'application/json', datatype: 'json', headers: { "ocp-apim-trace":"true", "ocp-apim-subscription-key":"bd9b6390881a4060bb2cd52b5a1d12d6" }, success: function (data) { alert('3'); alert(data); }, error: function(jqxhr,textstatus,errorthrown) { alert(jqxhr.status); alert(textstatus); alert(errorthrown); } }); } </script>
Comments
Post a Comment