How should nodejs accept data uploaded by ajax?

  node.js, question

I created a web page to edit and modify the xml file on the server side through the web page. The web page reads and modifies the xml file through JS and stores it in the global variable xmlDoc. I want to upload it through jquery and ajax.

Among them, the content of xmlDoc contains all the messy information in the whole xml document, including the title, so I don’t know how to upload it.

The expected method is the same as the following code:

function upload() {
 $.ajax({
 type:"POST",
 url:"/whatever",
 Data:"xml= "plus xmlDoc,
 dataType:"xml",
 });

The above is only the expected code and has not been tested (because I can’t even test it = = | |)
Since the value of xmlDoc is really at sixes and sevens, the upload of information has not been successful so far. I hope Touche can help revise it =. Equals sign
In addition, I can’t write the acceptance code of node. app.params and app.body don’t know which one to use and how to extract the information behind xml= please ask big touch to help solve OTL. thank you first

The client js should read as follows:

$.ajax({
 type:"POST",
 url:"/whatever",
 data: {xml: xmlDoc}
 });

Js can do this:

app.post('/whatever', function(req, res, next){
 // xml string
 console.log('xmlDoc:', req.body.xml);
 res.json(req.body.xml);
 });