xxxxxxxxxx
var a = [1,2,3],
xmlhttp = new XMLHttpRequest;
xmlhttp.open( "POST", "test.php" );
xmlhttp.setRequestHeader( "Content-Type", "application/json" );
xmlhttp.send( '[1,2,3]' ); //Note that it's a string.
//This manual step could have been replaced with JSON.stringify(a)