I did a test application, where I point to a web api that is online, the address of this api works and return the data if it is posted in the browser URL, it does a GET. In the test application I have:
<Div>
<Select id="method">
<Option value="get"> GET </option>
<Option value="post"> POST </option>
<Option value="put"> PUT </option>
</Select>
<Input type="button" value="Experimente" onclick="sendRequest()" />
<Span id='value1'>(Resultado)</span>
</Div>
@section scripts {
<script>
// TODO: Replace with the URL of your WebService app
var serviceUrl = ‘enderecoapi';
function sendRequest() {
var method = $('#method').val();
$.ajax({
type: method,
url: serviceUrl
}).done(function (data) {
$('#value1').text(data);
}).error(function (jqXHR, textStatus, errorThrown) {
$('#value1').text(jqXHR.responseText || textStatus);
});
}
</script>
}
You are not returning the data to me, I inspected the data and did not return an error, just "XHR finished loading: GET"