Package | com.curlyben.net |
Class | public dynamic class HTTPRequest |
Inheritance | HTTPRequest ![]() |
Property | Defined by | ||
---|---|---|---|
BaseStream : URLStream [read-only]
Provides access to the internal URLStream used to deliver a request.
| HTTPRequest | ||
Buffer : ByteArray [read-only]
Provides a byte level copy of the input buffer containing any downloaded data.
| HTTPRequest | ||
Host : String
The remote host address.
| HTTPRequest | ||
HTTPVersion : String
The HTTP protocol version to use when making requests.
| HTTPRequest | ||
IsSSL : Boolean [read-only]
Specifies whether the request URL uses a secure connection.
| HTTPRequest | ||
Port : uint
The port to connect to on the remote host.
| HTTPRequest | ||
RawHeader : String [read-only]
The HTTP response header as a multiline string.
| HTTPRequest | ||
RedHerringURL : String [static]
The URL to a "RedHerring" proxy.
| HTTPRequest | ||
Request : URLRequest [read-only]
The request object as type URLRequest.
| HTTPRequest | ||
RequestData : Object
Provides read/write access to request data.
| HTTPRequest | ||
RequestMethodOverride : String
The request objects HTTP method attribute, which may be overridden to bypass URLRequest method limitations.
| HTTPRequest | ||
Resource : String
The address of the requested resource less any domain/subdomain and protocol preamble.
| HTTPRequest | ||
ResponseCode : String [read-only]
The HTTP response word, for example "200" when a response header begins "HTTP/1.1 200 OK"
| HTTPRequest | ||
ResponseData : ByteArray [read-only]
The response data as a ByteArray.
| HTTPRequest | ||
ResponseDescription : String [read-only]
The HTTP response description, for example "OK" when a response header begins "HTTP/1.1 200 OK"
| HTTPRequest | ||
ResponseHeaders : Array [read-only]
An array of type Array<HTTPHeader> containing all recieved response headers.
| HTTPRequest | ||
ResponseWord : String [read-only]
The HTTP response word, for example "HTTP/1.1" when a response header begins "HTTP/1.1 200 OK"
| HTTPRequest |
Method | Defined by | ||
---|---|---|---|
HTTPRequest(redherring:String = null)
Creates an instance of HTTPRequest, optionally specifying a URL for a RedHerring proxy.
| HTTPRequest | ||
Close():void
Closes any unfinished streams and dispatchs the Event.CLOSE event.
| HTTPRequest | ||
GetHeader(name:String):HTTPHeader
Returns a named header if it is available, or a valueless header when no such header exists.
| HTTPRequest | ||
Load(urlrequest:URLRequest, requestdata:Object = null, forcemethod:String = null):void
Load a URL request optionally providing request data and HTTP method override.
| HTTPRequest |
Event | Summary | Defined by | ||
---|---|---|---|---|
This event is triggered when the remote host accepts a connection. | HTTPRequest | |||
This event is triggered when the request has completed loading all data. | HTTPRequest | |||
This event is triggered multiple times after the header is complete, and before the data is complete. | HTTPRequest | |||
This event is triggered when the header portion of a request has completed loading. | HTTPRequest | |||
This event is triggered when a URL is incorrectly constructed. | HTTPRequest | |||
This event is triggered when a connection is disconnected prematurely. | HTTPRequest |
Constant | Defined by | ||
---|---|---|---|
ER_MALFORMEDURL : String = "MalformedUrlError" [static]
Defines the value of the type property of an MalformedUrlError event object.
| HTTPRequest | ||
EV_CONNECTED : String = "connected" [static]
Defines the value of the type property of an connected event object.
| HTTPRequest | ||
EV_DATACOMPLETE : String = "dataComplete" [static]
Defines the value of the type property of an dataComplete event object.
| HTTPRequest | ||
EV_DATAPROGRESS : String = "dataProgress" [static]
Defines the value of the type property of an dataProgress event object.
| HTTPRequest | ||
EV_HEADERCOMPLETE : String = "headerComplete" [static]
Defines the value of the type property of an headerComplete event object.
| HTTPRequest | ||
EV_PREMATUREDISCONNECT : String = "prematureDisconnect" [static]
Defines the value of the type property of an prematureDisconnect event object.
| HTTPRequest | ||
HTTP_VER_1_0 : String = "1.0" [static]
A string constant used to set "1.0" as the HTTPVersion.
| HTTPRequest | ||
HTTP_VER_1_1 : String = "1.1" [static]
A string constant used to set "1.1" as the HTTPVersion.
| HTTPRequest |
BaseStream | property |
BaseStream:URLStream
[read-only]Provides access to the internal URLStream used to deliver a request.
Implementation public function get BaseStream():URLStream
Buffer | property |
Buffer:ByteArray
[read-only]
Provides a byte level copy of the input buffer containing any downloaded data.
Note:
Until the header is complete, data in the Buffer may not accurately represent any part of the data upon completion.
Buffer is made available to assist network debugging, and it is advised developers use ResponseData to access raw response data.
public function get Buffer():ByteArray
See also
Host | property |
Host:String
[read-write]The remote host address.
Implementation public function get Host():String
public function set Host(value:String):void
HTTPVersion | property |
HTTPVersion:String
[read-write]The HTTP protocol version to use when making requests.
Implementation public function get HTTPVersion():String
public function set HTTPVersion(value:String):void
See also
IsSSL | property |
IsSSL:Boolean
[read-only]
Specifies whether the request URL uses a secure connection.
Secure connections are not currently implemented.
public function get IsSSL():Boolean
Port | property |
Port:uint
[read-write]The port to connect to on the remote host.
Implementation public function get Port():uint
public function set Port(value:uint):void
RawHeader | property |
RawHeader:String
[read-only]The HTTP response header as a multiline string.
Implementation public function get RawHeader():String
RedHerringURL | property |
RedHerringURL:String
[read-write]
The URL to a "RedHerring" proxy.
A default URL will be formed from the application host URL and "redherring.php" if no value is specified.
At the time of writing there are version available for:
public static function get RedHerringURL():String
public function set RedHerringURL(value:String):void
Request | property |
Request:URLRequest
[read-only]The request object as type URLRequest.
Implementation public function get Request():URLRequest
RequestData | property |
RequestData:Object
[read-write]
Provides read/write access to request data.
Also referred to as POST data.
public function get RequestData():Object
public function set RequestData(value:Object):void
RequestMethodOverride | property |
RequestMethodOverride:String
[read-write]The request objects HTTP method attribute, which may be overridden to bypass URLRequest method limitations.
Implementation public function get RequestMethodOverride():String
public function set RequestMethodOverride(value:String):void
Resource | property |
Resource:String
[read-write]The address of the requested resource less any domain/subdomain and protocol preamble.
Implementation public function get Resource():String
public function set Resource(value:String):void
ResponseCode | property |
ResponseCode:String
[read-only]The HTTP response word, for example "200" when a response header begins "HTTP/1.1 200 OK"
Implementation public function get ResponseCode():String
ResponseData | property |
ResponseData:ByteArray
[read-only]
The response data as a ByteArray.
ResponseData will return a ByteArray of zero length if the header has not yet completed.
public function get ResponseData():ByteArray
ResponseDescription | property |
ResponseDescription:String
[read-only]The HTTP response description, for example "OK" when a response header begins "HTTP/1.1 200 OK"
Implementation public function get ResponseDescription():String
ResponseHeaders | property |
ResponseHeaders:Array
[read-only]
An array of type Array<HTTPHeader> containing all recieved response headers.
public function get ResponseHeaders():Array
See also
ResponseWord | property |
ResponseWord:String
[read-only]The HTTP response word, for example "HTTP/1.1" when a response header begins "HTTP/1.1 200 OK"
Implementation public function get ResponseWord():String
HTTPRequest | () | constructor |
public function HTTPRequest(redherring:String = null)
Creates an instance of HTTPRequest, optionally specifying a URL for a RedHerring proxy.
Parametersredherring:String (default = null ) — Specifies a URL for a RedHerring proxy.The URL provided will be copied into the static RedHerringURL, and therefore affect any future and present instances of HTTPRequest, and in course classes that implement HTTPRequest. If no URL is provided at any time, a default value "redherring.php" is used. |
Close | () | method |
public function Close():void
Closes any unfinished streams and dispatchs the Event.CLOSE event.
GetHeader | () | method |
public function GetHeader(name:String):HTTPHeader
Returns a named header if it is available, or a valueless header when no such header exists.
Parametersname:String — The name of the HTTP response header to return.
|
HTTPHeader —
A HTTPHeader object specific to the passed name parameter.
|
Load | () | method |
public function Load(urlrequest:URLRequest, requestdata:Object = null, forcemethod:String = null):void
Load a URL request optionally providing request data and HTTP method override.
urlrequest:URLRequest — The URLRequest object.
|
|
requestdata:Object (default = null ) — The URL request data, this is often the POST data.
|
|
forcemethod:String (default = null ) — The HTTP method to force, when URLRequest doesn't allow the required method.
|
connected | event |
com.curlyben.events.HTTPEvent
This event is triggered when the remote host accepts a connection.
dataComplete | event |
com.curlyben.events.HTTPEvent
This event is triggered when the request has completed loading all data.
dataProgress | event |
com.curlyben.events.HTTPEvent
This event is triggered multiple times after the header is complete, and before the data is complete.
headerComplete | event |
com.curlyben.events.HTTPEvent
This event is triggered when the header portion of a request has completed loading.
MalformedUrlError | event |
com.curlyben.events.HTTPEvent
This event is triggered when a URL is incorrectly constructed.
prematureDisconnect | event |
com.curlyben.events.HTTPEvent
This event is triggered when a connection is disconnected prematurely.
ER_MALFORMEDURL | constant |
public static const ER_MALFORMEDURL:String = "MalformedUrlError"
Defines the value of the type property of an MalformedUrlError event object.
EV_CONNECTED | constant |
public static const EV_CONNECTED:String = "connected"
Defines the value of the type property of an connected event object.
EV_DATACOMPLETE | constant |
public static const EV_DATACOMPLETE:String = "dataComplete"
Defines the value of the type property of an dataComplete event object.
EV_DATAPROGRESS | constant |
public static const EV_DATAPROGRESS:String = "dataProgress"
Defines the value of the type property of an dataProgress event object.
EV_HEADERCOMPLETE | constant |
public static const EV_HEADERCOMPLETE:String = "headerComplete"
Defines the value of the type property of an headerComplete event object.
EV_PREMATUREDISCONNECT | constant |
public static const EV_PREMATUREDISCONNECT:String = "prematureDisconnect"
Defines the value of the type property of an prematureDisconnect event object.
HTTP_VER_1_0 | constant |
public static const HTTP_VER_1_0:String = "1.0"
A string constant used to set "1.0" as the HTTPVersion.
See also
HTTP_VER_1_1 | constant |
public static const HTTP_VER_1_1:String = "1.1"
A string constant used to set "1.1" as the HTTPVersion.
See also