ASP.Net MVC Model Binding Complex Object using GET

前端 未结 3 1968
生来不讨喜
生来不讨喜 2021-02-20 17:48

I have a class in my web project:

public class MyClass
{
    public int? Param1 { get; set; }
    public int? Param2 { get; set; }
}

which is a

3条回答
  •  佛祖请我去吃肉
    2021-02-20 18:17

    The answer is Yes. The difference between GET and POST requests is that a POST body can have a content type so they can be interpreted correctly on the server side as XML, or Json, so on; for GET, all you have is just a querystring.

提交回复
热议问题