I’m trying to pass an array of JSON objects to my controller. When I insert an alert right before the ajax call the JSON appears to be well formed and all of the variables are populated correctly. However, when I inspect the payload of the ajax call I see that some of the variables contain nulls. What could be causing this? Did I make a mistake somewhere in my jQuery?
function postToController(instructionsJSON) {
alert(instructionsJSON);
$.ajax({
type: "POST",
url: "/Traffic/create",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: instructionsJSON,
success: function (result) {
console.log(result);
},
error: function (error) {
alert(error);
}
});
}


Seems to me that you’re inspecting two different sets of data.
If your server should be returning the same data but there’s a difference, then it has to do with whatever the server is doing to the data before it returns it.