Sending HTTP request with multiple parameters having same name

后端 未结 4 1787
粉色の甜心
粉色の甜心 2020-12-18 03:14

I need to send a HTTP request (and get XML response) from Flash that looks similar to following:

http://example.com/somepath?data=1&data=2&data=3
         


        
4条回答
  •  时光取名叫无心
    2020-12-18 03:53

    Disclaimer; I've never used Actionscript and have no means for testing this.

    Putting the same variable name with several values on the query string is the standard way of sending multi-value variables (for example form checkboxes) to web servers. If LoadVars is capable of sending multiple values then it seems plausible that the values should be stored in an array:

    req["someParam1"] = ["foo","bar","bas"];
    

    There also seems to be a decode function to LoadVars, what happens if you try to import the query string you want into the object?:

    req.decode("someParam1=foo&someParam1=bar&someParam1=bas");
    

提交回复
热议问题