I got the solution to send the JSON data by POST request through jquery ajax. I used below code
var data = new Object();
data.p_clientId = 4;
data = JSON.stringify(data);
$.ajax({
method: "POST",
url: "http://192.168.1.141:8090/api/Client_Add",
data: data,
headers: {
'Accept': 'application/json',
'Content-Type': 'text/plain'
}
})
.done(function( msg ) {
alert( "Data Saved: " + msg );
});
});
});
I used 'Content-Type': 'text/plain'
in header to send the raw json data.
Because if we use Content-Type: 'application/json'
the request methods converted to OPTION, but using Content-Type: 'test/plain'
the method does not get converted and remain as POST.
Hopefully this will help some one.