Using GET/POST in the Flash Authoring environment
September 17th, 2006 . by polyGeekThe Flash test environment always uses the GET method to send data via getURL or LoadVars. So if you’re using POST you’ll need to test in a browser to get a true test.
This really bit me in the ass one evening. I was finishing up work on the main Flash widget on XBox.com homepage which has an input TextField for searching games. I was using getURL and POST to send the data. I tested it in the authoring environment and everything worked perfectly. Searching for Halo send a query string to the server which produced the results I wanted. But, in the test environment it didn’t work. No query string was sent.
So I’m thinking that has to be some server issue because I know this thing works. After talking with the dev lead who was putting the page together we were stumped. Finally we found a tester who could look at all the data that was being sent between the pages and he noticed that I was using POST. The problem with that is that the server is set up to ignore POST data. (I have no idea why.)
That’s why the search worked in the authoring environment. It was being sent as GET but then in the browser it was being sent as POST as I had coded it.
By the way, the Flash help documents for getURL don’t mention this little oddity but the help page for LoadVars.send does.












I also learned that the Flash authoring tool always uses GET with the getURL method no matter if you set it to POST. That set me and the production team back a spell before we figured out what was what. …