Observation on posting data via Flash

Options

We've been working on a flash application that, among other things, contains donation API-based donation form. Because it's flash, most traditional tools used to debug asyncronous http calls don't work that well (no response shows, for example, in FireBug, only the post data and the HTTP response code -- 200 when it works and 40-something or other when it doesn't). After pounding my head on it for what seemed like ever... I figured out that, for whatever reason, the ActionsScript was URL encoding everything in the POST body -- not just the values, but the whole thing as one big string -- variable names included. It appears Convio doesn't like that... the solution, however, was simple:

var _Loader:URLLoader = new URLLoader();

var _Request:URLRequest = new URLRequest();

...

var tmpS = _Request.data;

_Request.data = unescape(tmpS);

...

_Loader.load(_Request);

(I'm leaving out all the other code needed in AS to do the post... but if you're actually trying to do this in Flash, you probably already have all that).

Anyway, don't know if anyone has had this same issue, but if so, here you go!

Tagged:

Categories