关于mvc、webapi中get、post、put、delete的参数

webapi中post提交的数据必须是一个类,get提交的数量无所谓
多种参数get时,参数名不能相同:
在能通过c#的校验的前提下,参数名、参数数量不能全完相同
 
        public string Get(int page, int pagesize)
        {
            return "test1";
        }

        public string Get(int page)
        {
            return "test2";
        }
这是没问题的
 
        public string Get(int page, int pagesize = 10)
        {
            return "test1";
        }

        public string Get(int page)
        {
            return "test2";
        }
这种就会报错
原文地址:https://www.cnblogs.com/yeagen/p/4078836.html