ActionScript 1/2 :: "POST" JSON Data In The Body Of A Request With LoadVars?

Mar 10, 2009

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 Replies


Similar Posts:


AS2 :: Post JSON Data From Flash With The JSON As The Body Of The Request?

Nov 5, 2010

I'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?

View 1 Replies

Flex :: Send HTTP POST Request With Binary Data In Body

Sep 17, 2009

I'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 Replies

AS2 :: Json - Add A Request Header To A LoadVars When Using GET (Flash)?

Oct 29, 2010

I'm working on a project built in Flash AS2.One of the things I need to do is load JSON data. In the past, I've had no problem with this - LoadVars works just fine.However, on this project, the JSON service that I'm calling requires the http request to include an ACCEPT header with "application/json".

LoadVars has an addRequestHeader method that allows me to add or change HTTP request headers, but according to the documentation, those headers are only sent with POST actions.Of course, in my case, the JSON service only allows GET requests.I tried using addRequestHeader anyway, but the header is not sent.(Of course, I could rebuild the application using AS3, which allows me to use URLLoader and URLRequest, but the application has WAY to much legacy AS2 code...)

View 1 Replies

Actionscript 3.0 :: Json : How To Post JSON Data

Dec 13, 2011

I have to work with webservices in Actionscript. I found the following code that allows me to use JSON URLs that implement only the GET method. However, it doesn't work for POST methods (doesn't even enter the "onComplete" method). How can i "POST" JSON data using Actionscript 3.0?

package
{
import flash.display.Sprite;
import flash.net.URLRequest;

[code]....

View 1 Replies

Flex :: Access Data Field Of A JSON Request Send By Client In JAX-RS?

Feb 2, 2012

I have the following JAX-RS service.[code]...

The JAX-RS service receives the request and respond successfully with some dummy response, but I have no access to the request.data field.

How do I access the data of the request message (which is {"type":"get_configuration","data":"some data"} in this particular example)? I think that I'm supposed to add some parameters to the handleMessage method like

public SomeResponse handleMessage(Object message) {...

but this does not work at all. The request got 415 response.

View 1 Replies

Php :: Reading RAW Data From A Flash POST Request ( Images )?

Dec 8, 2009

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.

View 1 Replies

IE Not Recognizing Post Data Using LoadVars From Flash Inside A Frameset?

Sep 16, 2010

This code is being run from a frameset in IE8. When the new window is opened, the form data is not being recognized. It appears that the http header, "content-type: application/x-www-form-urlencoded", is not being passed into IE and this is causing the post data not to be processed. The data is there, IE is just doing nothing with it.

This code works fine in FF and Chrome, and in fact the correct headers are passed in FF and Chrome.

NOTE: The new page is on a different site, but i don't know why that would cause a problem with a POST and not a GET.

Flash code:

varSender = new LoadVars();
varSender.title = _parent.tCourseTitle;
varSender.notes = input_txt.text;
varSender.send("http://example.com/notes/print.cfm", "_blank", "POST");

I have tried adding the header to the send request, but that has no effect at all. The contenttype header is still missing and it still works everywhere but IE.

My current work around is to use a GET instead of a post, but that's ugly and it limits us in the size of data we can pass but for now at least it works.

View 1 Replies

Send Xml Data To The Server Using HttpService Request Thr POST In Flex?

Dec 12, 2009

send xml data to the server using HttpService request thr POST in Flex?

View 1 Replies

Data Integration :: Firefox 2.x Sending Variables To PHP Scripts With The LoadVars.send / POST Method

Dec 29, 2006

There seems to be a problem with Firefox 2.x sending variables to PHP scripts with the LoadVars.send/POST method.

<br>

The same problem doesn't occur in IE or Opera. <br>See this url for example to try in both FF and IE/Opera: here. <br>The source files are here g.zelenka@iinet.net.au

View 4 Replies

Php :: Send POST Request With X-amf (Flash) Request Header?

Apr 13, 2011

I'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.

View 1 Replies

Actionscript 3 :: HTTPService Get Sent POST Body On FaultEvent?

Nov 9, 2011

Is it possible to get at the data that I sent via a HTTPService Send('I want to get at this data') method when a FaultEvent is raised? Either by looking at the global HTTPService variable or at the FaultEvent object.

View 1 Replies

Json :: Unable To Encode Flex Grid Data Into JSON On Sorting Columns?

Nov 28, 2011

Created an editable flex grid which exposes a method called getGridData() to javascript. I am using the JSON.encode() method of the [url]....library to convert the grid object's dataProvider into JSON before returning it.

ExternalInterface.addCallback("getGridData", getGridData);
public function getGridData():String
{[code].....

However, when I sort a column in the user interface, the encode method is failing throwing the following error

Property usingCustomCompareFunction not found on mx.collections.SortField and there is no default value.

View 1 Replies

ActionScript 2.0 :: Send JSON With LoadVars?

Jun 18, 2009

I am trying to make a simple POST using LoadVars. Since I am using an API there are some limitations though. The request must be send via POST with a JSON header. The body of the request should not contain name value pairs, but rather just a JSON object.

This last requirement has been troublesome for me because it seems like the only way to make a POST with LoadVars requires you to specify a variable name.

[Code]...

View 0 Replies

Php :: Json_decode - Malformed JSON From AJAX Request?

Oct 3, 2011

I am building a request in Flash that contains a JSON encoded Array of Objects. This is encoded using as3corelib. The request is then passed to JavaScript via ExternalInterface and a jquery ajax call sends the request off to the server.In PHP, the incoming data is parsed, but the json_decode returns null, giving a Malformed JSON error. var_dump results in comments:

<?php
(isset($_POST['gdata']) && !empty($_POST['gdata'])) ? $gamedata = $_POST['gdata'] : returnError("game data not specified");
var_dump($gamedata);[code]............

What I don't understand is that attempting to decode the variable returns null, but the same text decoded from a literal string works fine. What can I do to clean up the incoming data and make it readable for json_decode?

Edit: php_info() says that magic_quotes_gpc is enabled. Could that be the issue?

View 1 Replies

Actionscript 3 :: Json : Parsing JSON Data?

Sep 28, 2011

I am sending a request to a server, and in return I get a long block of JSON.

{
"response":"success",
"assignments":{
"17733":{
"asnid":"17733",

[code]....

Is there a way to do this? I checked if the property was enumerated and it returned true, but I cant find a way to access this data.

View 1 Replies

ActionScript 1/2 :: Send HTTP Request And Get The Response In JSON Format?

Aug 10, 2009

I am using ActionScript 2.0 for my app development. I have checked XML and LoadVars class. These classes by default send/receive data either in XML or name/value pair format. I want to send data in JSON format and receive the response in JSON format. How can I achieve this behavior using AS2.0. I have noticed that AS3.0 has the capabilities to do so. My client platform doesn't support AS3.0.

View 3 Replies

Actionscript 3 :: POST JSON Using Adobe Flex?

Mar 19, 2012

I'm trying to POST some JSON data using Adobe Flex but having some problems. I'm now getting the error message "A URL must be specified with useProxy set to false", even though I do have useProxy set to false.

Update : code below is now working.

[Code]...

View 1 Replies

ActionScript 2.0 :: POST Loadvars To Asp.net?

Mar 18, 2009

I am attempting to post 3 variables to an e-commerce page that was written in ASP.NET 2.0, but it is not working. I have deployed a simple .aspx page that echos the Request.Form object to the page so that I can see what it is receiving.When flash calls the loadvars.send() in Firefox I see what I would expect which is a list of keys value pairs.

View 1 Replies

ActionScript 3.0 :: POST Request In New Window?

Jan 29, 2011

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 Replies

ActionScript 2.0 :: LoadVars - Form Can't Send With GET / POST

Jun 19, 2011

I have a very simple form to send user data to a php file

when i run my form from FLASH PROFESSIONAL it send without problem

but when i run SWF or html with SWF no matter on lacal disc or website it doesn't work[code]...

View 1 Replies

As3 :: Flex - Pass Along An Incoming Xml Post Request?

Jun 15, 2011

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 Replies

Flash - Load A XML Via POST-request In Flex?

Feb 17, 2012

I'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?

View 2 Replies

ActionScript 3.0 :: Making A POST Request To A Script?

Feb 12, 2009

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 ?

View 0 Replies

ActionScript 3.0 :: How To Pass Array Via Post Request

Jul 31, 2009

When i crate flash mail list I past the variables via an object

Code:
variables.name = formName;
variables.mail = formMail;
etc.

View 2 Replies

ActionScript 3.0 :: How To Make Post Request With Tumblr API

Feb 2, 2010

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.

View 4 Replies

ActionScript 2.0 :: Use LoadVars To Send POST Without Attached Variable Name?

Jan 12, 2009

Let'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.

View 1 Replies

Django :: Flash - Iterate Over Chunks() With Request.POST?

Feb 17, 2010

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

View 1 Replies

Actionscript 3 :: Send A POST Request To An ASP.NET Asmx Web Service

Aug 24, 2010

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.

View 1 Replies

ActionScript 2.0 :: Include POST As A Method Of Sending LoadVars To The Php File?

Nov 21, 2008

I was just wondering if it is important to include POST as a method of sending loadVars to the php file. i was using POST before and i still ecountered some problems of receiving empty mails. Since i found an example which do not use POST or REQUEST method i dont have anymore prob. I just wanted to get another opinion about that as i wanna start using server side script with flash and i know that ill be using the POST method.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved