我正在努力API management
,exposing API using Javascript code
如果我去Developer portal
,check my url
它会给我correct result
如下所示
Response content
[{
"ContactId":1,
"Name":"Debra Garcia",
"Address":"1234 Main St",
},
{"ContactId":2,
"Name":"Thorsten Weinrich",
"Address":"5678 1st Ave W",
}]
but using javascript code I'm not getting anything Nor status error code :(
Js Code
<script type="text/javascript">
$(function() {
var params = {
'subscription-key': 'mykey',
};
$.ajax({
url: 'https://mydemo.azure-api.net/marketing/contacts?' + $.param(params),
type: 'GET',
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
我需要在哪里调试?