• webapi 参数的请求和接收


    数据传递和接收
    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"}
    这个时候是严格区分大小写的

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

  • 相关阅读:
    技术转型之路开启
    kotlin入门 (教程难点)
    linux入门
    Code-Breaking Puzzles做题记录
    bugku-login4-CBC字节翻转攻击
    bugku-就五层你能解开吗WP
    上海市数学教材
    书目推荐
    Zeta(2) 有图版
    UnitTest测试框架全栈详解(十)
  • 原文地址:https://www.cnblogs.com/muxueyuan/p/7357833.html
Copyright © 2020-2023  润新知