asp.net core webapi Post request data is not received ajax

Use the core2.2 

Excerpt from https://bbs.csdn.net/topics/392708657

Inside the core
FromBody corresponds application / json or xml format
FromForm corresponding www-for form-data format or

apiController this seemingly only 2.1 is started
without ApiController then FromForm default, default is added FromBody

If added ApiController then need to post the method parameters plus FromForm

[HttpPost("[action]")]
public IActionResult Login([FromForm]string user,[FromForm]string pwd)
        

Ending problem

 

Guess you like

Origin www.cnblogs.com/BGHAdmin/p/11583804.html