
81
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
LoadVars constructor
new LoadVars()
Creates a LoadVars object. You can use the methods of the LoadVars object to send and load data.
Availability
Flash Media Server 2
Example
The following example creates a LoadVars object called my_lv:
var my_lv = new LoadVars();
LoadVars.addRequestHeader()
myLoadVars.addRequestHeader(header, headerValue)
Adds or changes HTTP request headers (such as Content-Type or SOAPAction) sent with POST actions. There are two
possible use cases for this method: you can pass two strings,
header and headerValue, or you can pass an array of
strings, alternating header names and header values.
If multiple calls are made to set the same header name, each successive value replaces the value set in the previous call.
Availability
Flash Media Server 2
Parameters
header A string or an array of strings that represents an HTTP request header name.
headerValue A string that represents the value associated with header.
Example
The following example adds a custom HTTP header named SOAPAction with a value of Foo to the my_lv object:
var my_lv = new LoadVars();
my_lv.addRequestHeader("SOAPAction", "'Foo'");
The following example creates an array named headers that contains two alternating HTTP headers and their
associated values. The array is passed as a parameter to the
addRequestHeader() method.
var my_lv = new LoadVars();
var headers = ["Content-Type", "text/plain", "X-ClientAppVersion", "2.0"];
my_lv.addRequestHeader(headers);
The following example creates a new LoadVars object that adds a request header called FLASH-UUID. The header
contains a variable that the server can check.
var my_lv = new LoadVars();
my_lv.addRequestHeader("FLASH-UUID", "41472");
my_lv.name = "Mort";
my_lv.age = 26;
my_lv.send("http://flash-mx.com/mm/cgivars.cfm", "_blank", "POST");
Comentarios a estos manuales