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

@:value("application/x-www-form-urlencoded")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";

@:value("text/xml; charset=utf-8")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";

@:value("application/xml")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";

@:value("DELETE")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";

@:value("GET")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";

@:value("HEAD")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";

@:value("OPTIONS")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";

@:value("POST")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";

@:value("PUT")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";

@:value("TRACE")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

new()

Constructs an uninitialized HTTP request.

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.

@:flash.propertymethod:String

Indicates what method should be used for the request. The only values allowed are:

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";

Inherited Variables

Defined by AbstractMessage

@:flash.propertybody:Dynamic

The body of a message contains the specific data that needs to be delivered to the remote destination.

@:flash.propertyclientId:String

The clientId indicates which MessageAgent sent the message.

@:flash.propertydestination:String

The message destination.

@:flash.propertyheaders:Dynamic

The headers of a message are an associative array where the key is the header name and the value is the header value. This property provides access to the specialized meta information for the specific message instance. Core header names begin with a 'DS' prefix. Custom header names should start with a unique prefix to avoid name collisions.

@:flash.propertymessageId:String

The unique id for the message.

@:flash.propertytimeToLive:Float

The time to live value of a message indicates how long the message should be considered valid and deliverable. This value works in conjunction with the timestamp value. Time to live is the number of milliseconds that this message remains valid starting from the specified timestamp value. For example, if the timestamp value is 04/05/05 1:30:45 PST and the timeToLive value is 5000, then this message will expire at 04/05/05 1:30:50 PST. Once a message expires it will not be delivered to any other clients.

@:flash.propertytimestamp:Float

Provides access to the time stamp for the message. A time stamp is the date and time that the message was sent. The time stamp is used for tracking the message through the system, ensuring quality of service levels and providing a mechanism for message expiration.

See also:

Inherited Methods

Defined by AbstractMessage

toString():String

Returns a string representation of the message.

Returns:

String representation of the message.