Which is the best way (in performance and security) to send multiple parameters to a web page (on a different server), considering that the length of the parameters may vary because I’m sending a list of products, and the customer may have selected more than one product, so we need to send each product on the querystring to the other page.
For example (I’m on C#); I want to call a web page like this:
- Simple Querystring:
thepage.asp?Product=1&Name=Coffee&Value=1.99 - Json: thepage.asp?
{"Product":"1","Name":"Coffee","Value":"1.99"} - XML: thepage.aps?
<xml><Products><product>1</product><name>Coffee</name><Value>1.99</Value></Products>
(Obviouly considering we can’t send special characters via querystring, but I put them here for better understanding)
Which will be the better way (performance, security)?
Thanks in advance.
Based on your comment, you’re limited to what the third-party site will accept – if all it will handle is query-strings, that’s how you’ll have to send it. If it will handle form posts, then you could look at submitting the information in the headers of a post, but that is going to take more work (you also haven’t specified if you’re building a
WebRequeston the server side, or doing this through JavaScript on the client side).All things considered, here are some general points:
As to performance, it depends on the amount of processing you have to do to create the query strings over creating XML or JSON strings.