LoadVars.addRequestHeader()
Availability
Flash Player 6.
Usage
my_lv.addRequestHeader(headerName:String, headerValue:String) : Void
my_lv.addRequestHeader(["headerName_1":String, "headerValue_1" ...
"headerName_n", "headerValue_n":String]) : Void
Parameters
A string that represents an HTTP request header name.
headerName
headerValue
Returns
Nothing.
Description
Method; adds or changes HTTP request headers (such as
with
actions. In the first usage, you pass two strings to the method:
POST
. In the second usage, you pass an array of strings, alternating header names and
headerValue
header values.
If multiple calls are made to set the same header name, each successive value will replace the value
set in the previous call.
The following standard HTTP headers cannot be added or changed with this method:
,
,
Ranges
Age
Allow
,
,
Range
ETag
Host
Authorization
,
,
Upgrade
URI
Vary
Example
The following example adds a custom HTTP header named
the my_lv object:
my_lv.addRequestHeader("SOAPAction", "'Foo'");
The following example creates an array named
headers and their associated values. The array is passed as an argument to
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
. The header contains a variable that can be checked by the server.
UUID
var my_lv:LoadVars = 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");
382
Chapter 2:
A string that represents the value associated with
,
,
Allowed
Connection
,
,
Last-Modified
Locations
,
,
,
Public
Range
Retry-After
,
,
, and
Via
Warning
Content-Type
,
Content-Length
,
Max-Forwards
,
,
,
Server
TE
Trailer
.
WWW-Authenticate
SOAPAction
that contains two alternating HTTP
headers
.
headerName
or
SOAPAction
headerName
,
,
Content-Location
,
Proxy-Authenticate
,
Transfer-Encoding
with a value of
addRequestHeader()
) sent
and
Accept-
Content-
,
Proxy-
,
to
Foo
.
FLASH-
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers