Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 494315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:29:08+00:00 2026-05-13T05:29:08+00:00

I need to send a HTTP request (and get XML response) from Flash that

  • 0

I need to send a HTTP request (and get XML response) from Flash that looks similar to following:

http://example.com/somepath?data=1&data=2&data=3

I.e. having several parameters that share same name, but have different values.

Until now I used following code to make HTTP requests:

var resp:XML = new XML();
resp.onLoad = function(success:Boolean) {/*...*/};
resp.ignoreWhite = true;

var req:LoadVars = new LoadVars();
req["someParam1"] = 3;
req["someParam2"] = 12;

req.sendAndLoad("http://example.com/somepath", resp, "GET");

In this case this will not do: there will be only one parameter having last value.

What are my options? I’m using actionscript 2.

Added

I guess, I can do something like that:

var url:String = myCustomFunctionForBuildingRequestString();
var resp:XML = new XML();
resp.onLoad = function(success:Boolean) {/*...*/};
resp.load(url);

But in that case I am loosing ability to do POST requests. Any alternatives?

Changing request is not appropriate.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:29:08+00:00Added an answer on May 13, 2026 at 5:29 am

    Although POST may be having multiple values for the same key, I’d be cautious using it, since some servers can’t even properly handle that, which is probably why this isn’t supported … if you convert “duplicate” parameters to a list, the whole thing might start to choke, if a parameter comes in only once, and suddendly you wind up having a string or something … but i guess you know what you’re doing …

    I am sorry to say so, but what you want to do, is not possible in pure AS2 … the only 2 classes available for HTTP are LoadVars and XML … technically there’s also loadVariables, but it will simply copy properties from the passed object into the request, which doesn’t change your problem, since properties are unique …

    if you want to stick to AS2, you need an intermediary tier:

    1. a server to forward your calls. if you have access to the server, then you create a new endpoint for AS2 clients, which will decode the requests and pass them to the normal endpoint.
    2. use javascript. with flash.external::ExternalInterface you can call JavaScript code. You need to define a callback for when the operation is done, as well as a JavaScript function that you can call (there are other ways but this should suffice). Build the request string inside flash, pump it to JavaScript and let JavaScript send it to the server in a POST request and get the response back to flash through the callback.

    up to you to decide which one is more work …

    side note: in AS3, you’d use flash.net::URLLoader with dataFormat set to flash.net::URLLoaderDataFormat.TEXT, and then again encode parameters to a string, and send them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send data via http protocol (GET or POST request) from the
I need to send a http post request from my android device to a
I need to send a HTTP GET/POST request to an external API which returns
I need to be able to send a http get request to a web
I am new to C#, I need to send HTTP GET request and read
I need to send a http get request using c++. My code as of
We need send h264 from flash to Wowza and after to vlc by RTSP
Say I make an HTTP request to: foosite.com but the port I actually send
i need my application to send an HTTP request to my server, this is
I am trying to send HTTP request and recieve responce from the server over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.