문제

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

도움이 되었습니까?

해결책

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

var str:String=req.url+'?'+req.data;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top