我在ASP.net web API中使用api控制器,我需要通过[FromBody]类型将值传递给post方法.
[HttpPost] public HttpResponseMessage Post( [FromBody]string name) { .... }
我使用Postman插件但是当发送到post方法时,name的值总是为null ..请按照下图:
在Post方法中:
为什么会这样?!
c# asp.net-web-api postman
asp.net-web-api ×1
c# ×1
postman ×1