Home > Net >  The jquery ajax to submit the json data core3 unavailable at asp.net
The jquery ajax to submit the json data core3 unavailable at asp.net

Time:11-02

Postman submit raw JSON data to backend method can read correctly, but through the jQuery Ajax to submit the JSON data cannot be right!
Background method of parameter added [FromBody]

$. Ajax ({
Accepts: "application/json, not//not
DataType: "json",//not

//request address
Url: url1,
//request way
Type: "POST",
//request media type
ContentType: "application/json,"
//data, json string using the json. Stirngify is no
Data: {
"Year" : "2020",
"Month", "10",
"Dates" : [
{
"Date" : "the T16 2020-10-31:00:00. 000 z,"
"KeyOid" : "8 bad334e - 34 fd6 f6-4 - a2b2 - fbda3cb8826a",
"IsHoliday" : true
}
]
},
//request success
Success: the function (res) {
Dataloading=false;
console.log(res);
},
//request failed, contains specific error information
Error: function (err) {
Dataloading=false;
The console. The log (err);
}
});

Pray god to guide!
  • Related