Flex :: Make A POST Request With Parameters And An Attached File?
Apr 23, 2010Make a POST request with parameters and an attached file
View 1 RepliesMake a POST request with parameters and an attached file
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 RepliesSo 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 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 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.
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 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?
send xml data to the server using HttpService request thr POST in Flex?
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 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 RepliesWhat 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 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 ?
When i crate flash mail list I past the variables via an object
Code:
variables.name = formName;
variables.mail = formMail;
etc.
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.
I tried using var params: Object = ((this.stage.loaderInfo) as LoaderInfo).parameters; to get the parameters, but it returns an Object with no properties. That LoaderInfo will give me the correct URL without the parameters though if I use LoaderInfo.url. I'm using the request: http://localhost/foo.swf?start=foobar. params.hasOwnProperty("start") returns nothing, and using a for loop shows that "params" has no properties. How do I receive the start/foobar pair in my code? I would much prefer to not use FlashVars due to our setup.
View 2 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 RepliesLet's say I'd like to post some data to a server side script. If my data is
var data:String = "<data><tag1>hi</tag1></data>";
and I'd like to send it with LoadVars, I can do:
var lv:LoadVars = new LoadVars()
lv.data = data;
lv.sendAndLoad("http://thescript/", lv, "POST");
However, this results in the POST looking like this:
data=<data><tag1>hi</tag1></data>
if I want to send it without the variable name (no "data=", just the actual data), how is this possible? In AS3 I can just use the .data property of a URLRequest and it will work, however I can't find a way to do this in AS2.
I am desperately trying to make the movies in the attached file resize with the web browser but anchored to the white line on the left. The coloured buttons should not resize but move left or right to align with the edges of the pictures.
View 3 RepliesI 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;
[Code].....
But in that case I am loosing ability to do POST requests.
From an HTML form, I wish to launch my existing working flex application passing in parameters E.G, login details.[code]...
View 1 RepliesWhen 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 followed to tutorial to make the website and form but it just leaves you hanging at the end after ou made the form, i doesnt tell you how to make the .php file that sends the information to a email address. here is the Action Script 3.0 code for the form:
import flash.net.URLVariables;import flash.net.URLRequest;
InteractiveObject(theName.getChildAt(1)).tabIndex = 1;InteractiveObject(theEmail.getChildAt(1)).tabIndex =
[code]........
I have something like the following code:
Code:
var req:URLRequest = new URLRequest('child.swf');
var vars:URLVariables = new URLVariables();
vars.foo = 'bar';
[Code]....
but when I change URLRequestMethod.GET to URLRequestMethod.POST, I'm unable to. why, and if there's a workaround?
I am trying to get a xml file with data into Flex application. There are a lot of examples online passing parameter into f. However, it doesn't really work in my case.here is my code in HTML:
var flashvars = {};
flashvars.storageStatsXML = "stats.xml";
var params = {};
[code].....
Is there a way to rewite (or hijack) an absolute URL request made from a flash (swf) file in a browser?I have a flash application that is requesting URL..The code in the flash application cannot be changed but I want to be able to either use another flash or some javascript to write that URL as the image is beging requested - to something like URL...
View 1 Repliesi want to create instance of mxml (in my case EventList) and pass parameters. My Event List is a list of panels so I want to pass parameters and generate dynamically n number of panels (n-parameter to pass). I have the main app where I have toggle button bar when I click on the first I want for example to generate 3 panels (n=3) on the second button 20 panels (n=20) etc.How can I do this? How can I pass n and what is the best way to show the list? I whant to generate the list when I click on the toggle button!
View 1 RepliesHow to post data from a flex file to a php file? I am not able to create an action.
View 2 RepliesIs 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 Replies