posting JSON vs traditional form encoding as the data format for submitting data to the server from a HTML form. The HTML form is dynamic as in, the user can add new rows (for example) and fill in data. There is an argument that using form fields with an MVC framework is easier in this case since the MVC framework like Spring MVC takes care of the bindings to the form (generating id’s in the dynamically generated HTML etc) and we can have an object on the controller to collect these values when the form is posted using AJAX as a form encoded content type.
I was thinking of using JSON, what are your views?
- Is using form encoded format (the traditional way) the better option or is it using JSON as the payload the way to go? What are some of the pros and cons you have encountered?
- Are web applications using JSON as the data format for submitting forms?
- We currently do not have any integration with mobile apps etc so is it worth doing JSON over traditional form fields approach?
Thanks for your time.
You are comparing apples with hammers. JSON is data format while form is, well, let’s say, data source. You can send JSON data in HTML form fields, so this question is bit odd.
HTML forms? No
Again – read about the technologies you want to use. This helps to understand what it is. Do not start implementation prior getting elementary knowledge or you end wasting your time “refactoring” your project. From scratch…