Question

Example of code:

var variables:URLVariables = new URLVariables();  
variables.var1 = 123;
var req:URLRequest = new URLRequest('http://testdomain.com/api');
req.data = variables;
var loader:URLLoader = new URLLoader();
loader.load(req);

Okay, loader has executed request: http://testdomain.com/api?var1=123.
How can I save this request to string? req has url and variables but as separated data.

Thanks,
Nick

Was it helpful?

Solution

Just concatenate .url and .data property of the request object:

var str:String=req.url+'?'+req.data;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top