I'm attempting to send JSON data to a ColdFusion document that will process the data, but I'm hitting a brick wall.
The data is too long to run as a GET. I've tried setting it up as a POST, but nothing is being submit to the .cfm file (nothing shows up in the form scope.)
I'll try to type as much of the code as I can.
xhr = new XMLHttpRequest();
xhr.setRequestHeader("Content-length",JSON.stringify(finalarray).length + 9);
xhr.send('thisData=' + JSON.stringify(finalarray));
var reportText = xhr.responseText;
Now, in the ColdFusion document all I'm doing is a CFDUMP (raw data dump) of the form scope. So, reportText should be that. But it's coming up blank. Empty. Nothing.
How can I send a JSON string via xhr without using a form?