HTTP requests are sent to the HTTP endpoint using this message type. An HTTPRequestMessage encapsulates content and header information normally found in HTTP requests made by a browser.
Static variables
staticfinalread onlyCONTENT_TYPE_FORM:String = "application/x-www-form-urlencoded"
Indicates that the content of this message is a form.
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyCONTENT_TYPE_SOAP_XML:String = "text/xml; charset=utf-8"
Indicates that the content of this message is XML meant for a SOAP request.
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_SOAP_XML;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyCONTENT_TYPE_XML:String = "application/xml"
Indicates that the content of this message is XML.
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_XML;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyDELETE_METHOD:String = "DELETE"
Indicates that the method used for this request should be "delete".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.DELETE_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyGET_METHOD:String = "GET"
Indicates that the method used for this request should be "get".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.GET_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyHEAD_METHOD:String = "HEAD"
Indicates that the method used for this request should be "head".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.HEAD_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyOPTIONS_METHOD:String = "OPTIONS"
Indicates that the method used for this request should be "options".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.OPTIONS_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyPOST_METHOD:String = "POST"
Indicates that the method used for this request should be "post".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyPUT_METHOD:String = "PUT"
Indicates that the method used for this request should be "put".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.PUT_METHOD;
msg.url = "http://my.company.com/login";
staticfinalread onlyTRACE_METHOD:String = "TRACE"
Indicates that the method used for this request should be "trace".
The following example uses this constant:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.TRACE_METHOD;
msg.url = "http://my.company.com/login";
Constructor
Variables
contentType:String
Indicates the content type of this message. This value must be understood by the destination this request is sent to.
The following example sets the contentType
property:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
httpHeaders:Any
Contains specific HTTP headers that should be placed on the request made to the destination.
method:String
Indicates what method should be used for the request. The only values allowed are:
HTTPRequestMessage.DELETE_METHOD
HTTPRequestMessage.GET_METHOD
HTTPRequestMessage.HEAD_METHOD
HTTPRequestMessage.POST_METHOD
HTTPRequestMessage.OPTIONS_METHOD
HTTPRequestMessage.PUT_METHOD
HTTPRequestMessage.TRACE_METHOD
The following example sets the method
property:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";
recordHeaders:Bool
Only used when going through the proxy, should the proxy send back the request and response headers it used. Defaults to false. Currently only set when using the NetworkMonitor.
url:String
Contains the final destination for this request.
This is the URL that the content of this message, found in the
body
property, will be sent to, using the method specified.
The following example sets the url
property:
var msg = new HTTPRequestMessage();
msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
msg.method = HTTPRequestMessage.POST_METHOD;
msg.url = "http://my.company.com/login";