LoadVars.addRequestHeader()
317
Parameters
headerName
A string that represents an HTTP request header name.
headerValue
A string that represents the value associated with
headerName
.
Returns
Nothing.
Description
Method; adds or changes HTTP request headers (such as
Content-Type
or
SOAPAction
) sent
with
POST
actions. In the first usage, you pass two strings to the method:
headerName
and
headerValue
. In the second usage, you 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 will replace the value
set in the previous call.
The following standard HTTP headers
cannot
be added or changed with this method:
Accept-
Ranges
,
Age
,
Allow
,
Allowed
,
Connection
,
Content-Length
,
Content-Location
,
Content-
Range
,
ETag
,
Host
,
Last-Modified
,
Locations
,
Max-Forwards
,
Proxy-Authenticate
,
Proxy-
Authorization
,
Public
,
Range
,
Retry-After
,
Server
,
TE
,
Trailer
,
Transfer-Encoding
,
Upgrade
,
URI
,
Vary
,
Via
,
Warning
, and
WWW-Authenticate
.
Example
The following example adds a custom HTTP header named
SOAPAction
with a value of
Foo
to
the my_lv object:
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 an argument to
addRequestHeader()
.
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 can be checked by the server.
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");
See also
XML.addRequestHeader()
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...