webapi 参数的请求和接收
发布日期:2021-08-24 18:36:10 浏览次数:53 分类:技术文章

本文共 982 字,大约阅读时间需要 3 分钟。

数据传递和接收

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"}
这个时候是严格区分大小写的

第二种是试用于传入的是一个具体实体的时候

第三种适用于 没有具体实体的时候

转载于:https://www.cnblogs.com/muxueyuan/p/7357833.html

转载地址:https://blog.csdn.net/weixin_33831196/article/details/93278576 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java mongodb-crud
下一篇:【转】Netty那点事(一)概述

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月18日 12时50分00秒