Domanda

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

È stato utile?

Soluzione

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

var str:String=req.url+'?'+req.data;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top