Send JSON POST data with JQuery:
$.ajax
({
type: "POST",
url: 'example.php',
dataType: 'json',
async: false,
contentType: 'application/json',
data: JSON.stringify({ "myid": 1 , "mydata" : "Hello World!" }),
success: function () {
console.log("Success");
}
});