I am trying to implement a system which depends on the HTTP get/post parameter order.
I want the system provide a remote function call mechanism, for example:
Suppose there is a function foo(int, int)
, it can be called remotely by HTTP get http://ip:port/method=foo¶mType=int¶m=1¶mType=int¶m=2
or HTTP post with post data as method=foo¶mType=int¶m=1¶mType=int¶m=2
, which acts as call foo(1,2)
locally.
As you see, it depends on parameter order extremely. If parameter order goes wrong, foo(2,1)
will be called unexpected.
But I am not sure is it reliable, since I think W3 did not make a spec for the parameter order(tell me if I'm wrong).
I am not sure the parameter order will be as expected at three points:
- Will the client(such as a browser or jmeter) post the parameter in order as you see?
- Will the order be preserved during transmission?
- Will the web contain(such as tomcat) or the web framework(such as django) preserve the parameter order?
I did a few tests, found chrome, firefox and jmeter will send get/post parameter as expected and tomcat preserved the parameter order, but it's a hard work to find negetive cases and I am not sure there is no such cases. So I can't be sure is the system I am trying to implement is reliable.
Does anyone have any experiences for such problem? All suggestions are welcome.