jQuery posts null instead of JSON to ASP.NET Web API

后端 未结 5 753
南笙
南笙 2020-12-05 19:12

I can\'t seem to get this to work... I have some jQuery like this on the client:

$.ajax({
    type: \"POST\",
    url: \"api/report/reportexists/\",
    data         


        
5条回答
  •  情歌与酒
    2020-12-05 19:52

    $.post served the purpose for me. Remove the [FromBody] from webapi and give the url in the url parameter of the $.post in jquery client. It worked!

提交回复
热议问题