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.
views:
27answers:
2
+1
A:
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.
Keith Rousseau
2010-06-09 02:22:58
So I would have to do a work around if I wanted to submit a class or an array?
Brook Julias
2010-06-09 11:32:43
That completely depends on what framework you are using. In ASP.NET MVC, the ModelBinder will take care of binding your data to a class. It is based on naming conventions. http://msdn.microsoft.com/en-us/library/dd410405.aspx
Keith Rousseau
2010-06-09 12:04:16
I am using PHP with no other framework when what is involved with the initial install.
Brook Julias
2010-06-09 15:14:06
Well in that case you will have to go into the $_POST array and get the variables out on your own and convert them to your datatype. There are a number of MVC frameworks for PHP - I would suggest that you use one - http://stackoverflow.com/questions/1961669/php-mvc-framework
Keith Rousseau
2010-06-09 17:01:54
A:
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.
Gert G
2010-06-09 02:33:52