Example
The following example adds a custom HTTP header named
to an XML object named
my_xml.addRequestHeader("SOAPAction", "'Foo'");
The following example creates an array named
headers and their associated values. The array is passed as a parameter to the
addRequestHeader()
var headers:Array = new Array("Content-Type", "text/plain", "X-
ClientAppVersion", "2.0");
my_xml.addRequestHeader(headers);
See also
addRequestHeader (LoadVars.addRequestHeader method)
contentType (XML.contentType property)
public contentType : String
The MIME content type that is sent to the server when you call the
XML.sendAndLoad()
is the standard MIME content type used for most HTML forms.
Availability: ActionScript 1.0; Flash Player 6
Example
The following example creates a new XML document and checks its default content type:
// create a new XML document
var doc:XML = new XML();
// trace the default content type
trace(doc.contentType); // output: application/x-www-form-urlencoded
The following example defines an XML packet, and sets the content type for the XML object.
The data is then sent to a server and shows a result in a browser window.
var my_xml:XML = new XML("<highscore><name>Ernie</name><score>13045</
score></highscore>");
my_xml.contentType = "text/xml";
my_xml.send("http://www.flash-mx.com/mm/highscore.cfm", "_blank");
Press F12 to test this example in a browser.
See also
send (XML.send method)
1290
ActionScript classes
:
my_xml
method.
method. The default is
,
sendAndLoad (XML.sendAndLoad method)
SOAPAction
that contains two alternating HTTP
headers
application/x-www-form-urlencoded
with a value of
Foo
or
XML.send()
, which
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?
Questions and answers