.net core api Post请求
POST请求:
1、请求类型:Content-Type:application/json,参数:json字符串
后台接收参数:
1)([FromBody]UserInfo user)必须以对象形式接收,(int id, string name)无法获取值
2)([FromBody]dynamic info) var id=info.id as int;
3)([FromBody]JObject obj) var id=obj["id"] as int;
2、请求类型:Content-Type:application/x-www-form-urlencoded,参数:key1=value1&key2=value2
后台接收参数:
1)(int id, string name)
2)([FromForm]UserInfo user)
请随手写下你的想法!!!