我有一个看起来有点像这样的方法:
/// <summary>
/// Updates the status to paid
/// </summary>
/// <param name="data">The data from world pay</param>
/// <returns></returns>
[HttpPost]
[Consumes("application/x-www-form-urlencoded")]
public IActionResult Residential([FromForm] string data)
{
if (string.IsNullOrEmpty(data)) return BadRequest("No data was present");
var model = JsonConvert.DeserializeObject<WorldPayResponseModel>(data);
// ----- removed from brevity ----- //
return Ok(true);
}
当我使用邮递员发送一些数据时,它始终为空。
有谁知道为什么会这样?