Express4.x framework req.body cannot get foreground post data

  node.js, question
var option={
 type:"POST",
 url:"/",
 contentType:"application /json;  charset:utf-8",
 dataType:"json",
 data:{
 ok:"on",
 temperature:"18",
 bracket
 success:function(response){
 console.log(response);
 bracket
 error:function(err){
 alert(err);
 bracket
 bracket
 $.ajax(option);

The above is the front desk code. .

app.post("/",function(req,res){
 var data={
 ok:req.body.ok,
 temperature:req.body.temperature
 bracket
 console.log(data);
 })

The final output is{ok:undefined,temperature:undefined}

Express framework I used.

app.use(bodyParser());
 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded({ extended: true }));

Modules parsed by bodyParser used. However, the value in req.body still cannot be resolved.

Jquery’s ajax method, inside, sets the contentType to set the requested contentType, while the requested contentType has only three types: Application/X-WWW-Form-Urlencoded (default), multipart/form-data, text/plain. Application/json is usually the contentType of the response, while in jquery’s ajax method inside, dataType:’json’ is used to set the contentType of the response to json