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.