Pergunta

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

Foi útil?

Solução

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

var str:String=req.url+'?'+req.data;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top