I am trying jQuery Ajax for consuming rest service. Ajax request type is 'POST'. When I am try to load this then request is going as "OPTIONS" and I'm getting "501 Not Implemented" ( as shown in image)
<script>
var user ="user:pwd";
var auth = "Basic " + btoa(user);
$(function(){
$.ajax({
type: 'post',
url: 'https://xyz/api/core/v3/xyz',
dataType: 'json',
contentType: 'application/json',
data: '{"title":"test","content":"testpega" }',
success: function(resp) {
$('#log').html("success");
},
error: function(e) {
$('#log').html("error: "+e);
}
});
});
</script>
Any help/suggestion ?
Note: I am able to use same webservice with FireFox rest-client add-on.