数据传递和接收
1.数据头为
User-Agent: Fiddler
Accept: application/xml; charset=utf-8
Host: localhost:1258
Content-Length: 26
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
sign: 9f89c84a559f573636a47ff8daed0d335
的时候 数据格式为
UserName=张三1&Pwd=admin
2
User-Agent: Fiddler
Accept: application/xml; charset=utf-8
Host: localhost:1258
Content-Length: 26
Content-Type: application/json
sign: 9f89c84a559f573636a47ff8daed0d335
的时候
public ResultData<string> Login(UserInfoModel user)
{
string username = user.UserName;
string pwd = user.Pwd;
}
传参{"UserName":"张三1"}
这个时候是没有严格区分大小写的
3
User-Agent: Fiddler
Accept: application/xml; charset=utf-8
Host: localhost:1258
Content-Length: 26
Content-Type: application/json
sign: 9f89c84a559f573636a47ff8daed0d335
的时候
public ResultData<string> Login(dynamic user)
{
string username = user.UserName;
string pwd = user.Pwd;
}
传参{"UserName":"张三1"}
这个时候是严格区分大小写的
第二种是试用于传入的是一个具体实体的时候
第三种适用于 没有具体实体的时候