ActionScript 3.0 :: How To Pass Array Via Post Request
Jul 31, 2009When i crate flash mail list I past the variables via an object
Code:
variables.name = formName;
variables.mail = formMail;
etc.
When i crate flash mail list I past the variables via an object
Code:
variables.name = formName;
variables.mail = formMail;
etc.
I need to pass along an incoming xml post request using as3? Is there a simple way to just pass that request through an as3 application? I don't want to do anything with the request other than send it along to its destination.
View 1 RepliesI'm trying to reproduce a POST request that was captured from WireShark using PHP. This POST request was sent by a Flash (.swf) object, so it's a little bit complicated in configuring the header.It does not print out anything in the end, so there must be something wrong with PHP code that I could not see.Here is what WireShark captured:
POST /engine/ HTTP/1.1
Host: abcdef.com
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[code]....
The result is a blank page instead of response from server.
What i want to do is open a new browser window, (preferably a pop-up window) and have it display results based on POST data sent from flash. Like a form that targets _blank or something.
View 1 RepliesI'm trying to load a XML via POST-request in Flex:
var request:URLRequest = new URLRequest('res/unhasher.xml');
request.method = URLRequestMethod.POST;
loader = new URLLoader();
loader.load(request);
But in Firebug I see that my file is loaded through GET.
Request header:
GET res/unhasher.xml HTTP/1.1
Host: bla-bla-bla.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1
[code]....
How to make POST requests from Flash/Flex?
I would like to make a simple call to a script passing the data via http POST.In particular I would like to pass two parameters:
1) a file
2) a string containing the name of the file
How can I do that ?
So I'm trying to code an AIR widget for Tumblr. Before I actually start working on the widget, I wanted to play around with AS3 and the Tumblr API to do simple things, like reading and writing posts, editing posts etc. I got reading posts working, but when it comes to creating posts I run into an unknown brickwall. Here's the instructions from Tumblr's API doc on making a POST request:
The Write API is a very simple HTTP interface. To create a post, send a POST request to [URL] with the following parameters:
Email - Your account's email address.
password - Your account's password.
type - The post type.
These are the valid values for the type parameter, with the associated content parameters that each type supports:
Regular - Requires at least one:
Title
Body (HTML allowed)
[URL]
And here's my AS3 code:
import flash.net.*
gogo.buttonMode = true; // gogo is the instance name of a MC on the stage
gogo.addEventListener(MouseEvent.MOUSE_DOWN, go);
function go(e:MouseEvent):void{
var variables:URLVariables = new URLVariables();
[Code] .....
And for the life of me, no matter how simple I make this code, I cannot get it to work.
I'm basically interacting with a third party API flash file to send HTTP POST requests to my server. know I'm on somewhat the right path because it requires a crossdomain.xml file, and before I added that part nothing in the POST variables was showing up, however since I added that file there are 4 variables that are set, these POST variables are sent by the application to give me basic information about the file.. but I actually need to read the RAW POST data to actually save the image being sent by the Flash.I'm aware there are 3 ways...$GLOBALS['HTTP_RAW_POST_DATA'] $HTTP_RAW_POST_DATA which is probably the same as the firstfile_get_contents('php://input')For whatever reason, neither of these "work". By "work" I mean they're not being set, when I var dump them I get nothing.
Could it be that there's a setting in php.ini that I need to set, or perhaps the Flash application is truly not sending the actual image? I think it's doing the right thing, because it's a semi popular API and it's used by a couple other sites so I'm pretty sure it's right on their end.
I'm trying to optimize a site I'm building with Django/Flash and am having a problem using Django's iterate over chunks() feature. I'm sending an image from Flash to Django using request.POST data rather than through a form (using request.FILES). The problem I foresee is that if there is large user volume, I could potentially kill memory. But it seems that Django only allows iterating over chunks with request.FILES. Is there a way to:
1) wrap my request.POST data into a request.FILES (thus spoofing Django)
or
2) use chunks() with request.POST data
When trying to send a POST request to an ASP.NET asmx web service I am seeing (in Charles and Firebug) it go through as a GET. Here is my AS3
[Code]...
This seems to be an issue with flash as it is happening before it even goes to the server. I have uploaded this to a testing server and I still see it come through as a GET.
send xml data to the server using HttpService request thr POST in Flex?
View 1 RepliesMake a POST request with parameters and an attached file
View 1 Repliesis it possible for flash widge on site a.com to send POST request to b.com ?If so, couldn't this be quite dangerous ? A user would be performing POST to an unknown host
View 1 RepliesI am sending the parameters from flex application through HTTP POST request to Python/PSP script. I am able to call PSP script from flex app using HTTP POST request, but i am not able to use/retrieve these parameters in Python/PSP
View 1 RepliesI'm new to Flex and couldn't figure out yet how to send binary data to the server as the body of a POST request. The HTTPService component doesn't seem to support this. The FileReference doesn't seem to support setting the data via the Flex API.
View 4 RepliesI have a problem with the following code:[code]The problem is that the code is working when I test the scene (ctr+alt+enter in flash), but after I publish it it doesn't work... not sending any request nor redirect.What I want to do is to log in a file on the server what the users typed (related with Related with: Flash actionscript - save a text file on server).
View 1 RepliesI'm passing the following parameter as an url fragment to flex. (#groupID=2385)
This works great on the development box, but when I put it on the production server.. nothing.
Do you think this is a server configuration issue. I presume that flex is talking to the javascript file 'AC_OETags.js' to make this all happen.
Is it possible to "POST" JSON data in the body of a request with LoadVars? I understand LoadVars sends data as name>value pairs. How can I send the data in the body instead?
View 1 RepliesI basically have a form inside of Flash that I need to submit to a server-side processing page, which will then return either json or xml telling if it succeeded or not ( json, xml I suppose ). My version of Flash is CS4 and I'm wondering if there are any libraries or frameworks I can use to accomplish this.
View 2 RepliesI'm working on a Flash AS2 application that needs to post JSON data to a web service.In previous projects, I've used LoadVars.send() or LoadVars.sendAndLoad() successfully to manage this:
var send_lv:LoadVars = new LoadVars();
send_lv.data = JSON.stringify({some json object});
var response_lv:LoadVars = new LoadVars();
response_lv.onData = function(rawdata) {
[code]....
In somepage.php, I can grab that JSON data using $_POST['data'].However, on this project, the developer of the web service requires the JSON content to be the BODY of the request (i.e., not a name/value pair). Is this possible with LoadVars?
How can I pass a Form post variable into Flash?
View 3 RepliesOK, you can use loadVariables and loadVars and a few other commands to post (or get) a variable to a server. What I'm trying to do is post an Array to a server and have the server output a text file of the array.
I have been toying with perl / cgi a bit: gaining some in site on Data Base programming. Would Perl be a decent program for the job of outputting a text file?
I'm sending an array of 20 items to a PHP script. Here's the sendAndLoad call:
Code:
rankedSubmitBtn.onRelease = rankedSubmitBtn.onReleaseOutside = function():Void
{
[code].....
When Flex application make an asynchronus HTTP request, does it add a special header to the request, like some JavaScript framework does? Something that indicates whether this request is an AJAX call/not.I just want my server side code to return different response format, depending on whether the request is made from browser/flex.
View 1 RepliesI have a webpage that accepts POST variables, I can post normal variables to it from flash like this:
Code:
lv = new LoadVars ();
lv.myvar1= "test1";
[code]........
I have some basic experience with using URLRequest to POST variables to my server which works fine.How do I post an array to my server and receive it back?
View 3 RepliesI need some help creating an array from a string send via POST from a php loop.The string looks sorta like this: keyword=key1val &
text=text1val & keyword=key2val & text=text2val
(spaces added for readability)
I have a little bit of control over how the string is sent. So I could add numbers to the keys in the string, so they read like this
keyword1=key1val & text1=text1val & keyword2=key2val
basically I want to then end up with an array
noteCards[0] = ["key1val", "text2val"];
noteCards[1] = ["key1val", "text2val"];
I have the following array as3 example:
var arrayDefinitionsargsAmfPhp:Array = new Array();
arrayDefinitionsargsAmfPhp['tabela'] = "controls";
arrayDefinitionsargsAmfPhp['width'] = "100";
[code].....
Im building a reservation form, using actionscript and php. I use sendAndLoad to send variables to php via POST, which returns a different HTTP POST response in case of sucess or not.
Is there anyway to "read" HTTP POST responses with actionscript?
I am making dynamic post values to post to a URL.
[Code]...
Maybe I am doing this the hard way with eval, is there an easier way, such as passing an array of post variables?