What are the data type limitations of the POST and

2019-06-28 02:20发布

问题:

What are the data type limitations of the POST and GET HTML Form Methods? Are you limited to passing only specific data types like--strings, integers, floats.

回答1:

POST and GET both submit strings to the server. It is up to your program to determine how to parse that data. Most frameworks give you a basis to do this already that support most primitive datatypes. In the case of ASP.NET MVC, it can bind to most objects.



回答2:

Of what I'm aware, there's no data type limitations, but there's another limitation. GET has a maximum length that varies between browsers. As a general rule, I use POST for form submissions that doesn't require that the user should be able to bookmark or send the URL to someone.