0

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

3
  • 1
    Is this what you need? req.url+'?'+req.data Commented May 15, 2014 at 17:23
  • 1
    It's good to close the question if you've found the answer, which I think you did :) @null.point3r - you could write it as an answer so he can close the question.. Commented May 15, 2014 at 19:02
  • 1
    @AndreyPopov You're right. If he'll write an answer, I'll close question :) Commented May 15, 2014 at 19:57

1 Answer 1

2

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

var str:String=req.url+'?'+req.data;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.