Greetings,
This is one of those I wonder if it's possible questions and then if so is it worth pursuing?
Deciding whether a form should use the GET or POST method to return its values is sometimes easy and other time a toss up.
One big advantage of GET is our users can past a URI into the trouble report and we can reproduce the exact command they are having trouble with. Another is they can pass it onto another user to reproduce results.
One big disadvantage of GET is that the length of the data returned is limited and that limit varies on, I think, browser and client OS.
I am working on a
Java Enterprise app where GET is a nice fit MOST of the time. One of my biggest issues from day 1 is that providing powerful ways to express requests can lead to unreasonable requests (for a browser app, not the user).
I think an example is needed to help this discussion along.
My application is a data visualization tool for a large international scientific collaboration (
http://www.ligo.org). The data stores now have about 2PB of data and when the advanced version of the instruments come on line toward the end of 2014, early 2015 we expect to be adding about 10MB/s from 2 observatories or 1PB/year. This data is organized in channels and depending on how you count derivative channels and data stores we have somewhere between 750K and 13M channels. It's common to compare data from different channels or to look at the same channel at different times. So the UI that selects channels and times is fairly general with "select all" and "repeat every" buttons. The problem is if they select too many things they get an error from the Browser because the URI is too long and it is expressed in technobabble or gobledegook, which results in a trouble ticket or email.
I can think of criteria to decide whether a GET or POST method would be more appropriate, but it would have to happen in Javascript on the client side.
All that verbiage just leads to these fairly simple Javascript questions. I am not a Javascript expert by any means so they are very basic.
Are there any disadvantages to having a form that uses GET sometimes and POST others
When the user hits the submit button, I can count the number of form elements and decide GET or POST, can I modify the method in JS?
The other question is can I remove form elements from the submit process. For example if the check box that says use this plot product is not selected I don't need the many parameter for that product to be sent. In the POST scenario this is not a big deal they don't eat much bandwidth but they do make the URI much longer.
One of the benefits of using the Ranch, is that taking the time to express a problem in a way that others can understand often leads to not only a better understanding of what confuses me but also several ways to research the answer myself.
I'm going to hit the Submit button anyway and would appreciate any comments and advice.
Thanks,
Joe