Copy link to clipboard
Copied
I want to send values from Flash to REST Service (Different Domain) through RequestHeader using GET method.
When I use the following code the header values are not attached with the request. Please help me on this
var request:URLRequest = new URLRequest();
request.url="http://www.myexample.com/"
var headers:Array = [new URLRequestHeader("name", "value")];
request.requestHeaders=headers;
request.method = URLRequestMethod.GET;
var loader:URLLoader=new URLLoader(request);
Copy link to clipboard
Copied
Take a look at the GET example here (URLVariables is the key):
http://help.adobe.com/en_US/as3/dev/WSb2ba3b1aad8a27b061afd5d7127074bbf44-8000.html
Copy link to clipboard
Copied
Thanks for your reply. The example is adding the parameters to the URL not adding the request header.
Copy link to clipboard
Copied
The URLVariables will be handed to a RESTful service via GET. The URL they're using in the GET example has no URL parameters. The information is contained in the URLVariables to complete the GET request (e.g. variables.method = "test.echo"; // tell the RESTful GET request which method to invoke).
Copy link to clipboard
Copied
request is completed without sending the request header.
Copy link to clipboard
Copied
Flash follows SOAP so yes, it just supports POST and GET (not PUT or DELETE), etc. I thought what you meant by 'GET' was arguments in the URL.
If you truely need it in headers you're pretty out of luck except for essentially using a proxy, e.g.:
Copy link to clipboard
Copied
Flash doesn't but just for posterity, AIR has DELETE and PUT as a valid URLRequestMethod.
Copy link to clipboard
Copied
Most places that need to use a RESTful service with Flash have a way to fake it--Flash can't send the PUT and DELETE parts.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now