I am not expert in jQuery, consider me fresher. Here is my code which one not responsible for jQuery JSON data submission by Request Body.
Here is the right code for your desired out put.
$.ajax({
url : "/",
type: "POST",
data: JSON.stringify([
{id: 1, name: "Shahed"},
{id: 2, name: "Hossain"}
]),
contentType: "application/json; charset=utf-8",
dataType : "json",
success : function(){
console.log("Pure jQuery Pure JS object");
}
});
Your must convert JS Object to String and JSON.stringify(JSObject)
is the method responsible for that.