webapi 参数的请求和接收
2021-09-22 16:14
标签:webapi utf-8 str ddl 区分 set for user 数据格式 数据传递和接收1.数据头为User-Agent: FiddlerAccept: application/xml; charset=utf-8Host: localhost:1258Content-Length: 26Content-Type: application/x-www-form-urlencoded; charset=UTF-8sign: 9f89c84a559f573636a47ff8daed0d335的时候 数据格式为 UserName=张三1&Pwd=admin 2User-Agent: FiddlerAccept: application/xml; charset=utf-8Host: localhost:1258Content-Length: 26Content-Type: application/jsonsign: 9f89c84a559f573636a47ff8daed0d335 的时候 public ResultData Login(UserInfoModel user) { string username = user.UserName; string pwd = user.Pwd; }传参{"UserName":"张三1"}这个时候是没有严格区分大小写的 3User-Agent: FiddlerAccept: application/xml; charset=utf-8Host: localhost:1258Content-Length: 26Content-Type: application/jsonsign: 9f89c84a559f573636a47ff8daed0d335 的时候 public ResultData Login(dynamic user) { string username = user.UserName; string pwd = user.Pwd; }传参{"UserName":"张三1"}这个时候是严格区分大小写的 第二种是试用于传入的是一个具体实体的时候第三种适用于 没有具体实体的时候webapi 参数的请求和接收标签:webapi utf-8 str ddl 区分 set for user 数据格式 原文地址:http://www.cnblogs.com/muxueyuan/p/7357833.html