Apache Flex (FlexJS) 0.7.0 API Reference | All Packages | All Classes | Index | Frames No Frames |
HTTPService

Package | org.apache.flex.net
Class | public class HTTPService
Inheritance | HTTPService HTTPServiceBase EventDispatcher flash.events.EventDispatcher
Implements | IStrand, IBead

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The HTTPService class is a class designed to transfer text over HTTP. Use BinaryUploader for transferring non-text.

Default MXML Property `beads`

See also

org.apache.flex.net.BinaryUploader.

Public Properties

| Property | Defined By
--- | --- | ---
|  | beads : Array An id property for MXML documents. | HTTPService
|  | contentData : String The text to send to the server, if any. | HTTPService
|  | contentType : String The content-type of the binary data. | HTTPService
|  | data : String [read-only] The text returned from the server. | HTTPService
|  | headers : Array The HTTP headers to be sent with the upload. | HTTPService
|  | id : String An id property for MXML documents. | HTTPService
|  | json : Object [read-only] A JSON object parsed from the data. | HTTPService
|  | method : String The HTTP method for the upload. | HTTPService
|  | responseHeaders : Array [read-only] The HTTP headers that were received from the server if any. | HTTPService
|  | responseURL : String [read-only] The value of the responseURL header, if any. | HTTPService
|  | status : int [read-only] The http status code from the server, if any. | HTTPService
|  | strand : IStrand [write-only] | HTTPService
|  | timeout : Number A timeout value for server response. | HTTPService
|  | url : String The url of the server. | HTTPService

Public Methods

| Method | Defined By
--- | --- | ---
|  | HTTPService() Constructor. | HTTPService
|  | addBead(bead:IBead):void Add a bead to the strand. | HTTPService
|  | getBeadByType(classOrInterface:Class):IBead Find a bead on the strand. | HTTPService
|  | removeBead(value:IBead):IBead Remove a bead from the strand. | HTTPService
|  | send():void Sends the headers and contentData to the server. | HTTPService

Protected Methods

| Method | Defined By
--- | --- | ---
|  | completeHandler(event:Event):void The handler for the COMPLETE event. | HTTPService
|  | ioErrorHandler(event:IOErrorEvent):void The handler for the IO_ERROR event. | HTTPService
|  | statusHandler(event:HTTPStatusEvent):void The handler for HTTP_STATUS and/or HTTP_RESPONSE_STATUS events | HTTPService

Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | complete | Dispatched when the request is complete. | HTTPService
|  | httpResponseStatus | Dispatched if Adobe AIR is able to detect and return the status code for the request. | HTTPService
|  | httpStatus | Dispatched when an httpStatus code is received from the server. | HTTPService
|  | ioError | Dispatched if an error occurs in the server communication. | HTTPService

Property Detail

beads | property

`public var beads:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

An id property for MXML documents.

contentData | property |

`contentData:String`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The text to send to the server, if any.

Implementation
`public function get contentData():String`
`public function set contentData(value:String):void`

contentType | property |

`contentType:String`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The content-type of the binary data.

Implementation
`public function get contentType():String`
`public function set contentType(value:String):void`

data | property |

`data:String` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The text returned from the server.

Implementation
`public function get data():String`

headers | property |

`headers:Array`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The HTTP headers to be sent with the upload.

Implementation
`public function get headers():Array`
`public function set headers(value:Array):void`

id | property |

`id:String`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

An id property for MXML documents.

Implementation
`public function get id():String`
`public function set id(value:String):void`

json | property |

`json:Object` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

A JSON object parsed from the data.

Implementation
`public function get json():Object`

method | property |

`method:String`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The HTTP method for the upload.

Implementation
`public function get method():String`
`public function set method(value:String):void`

responseHeaders | property |

`responseHeaders:Array` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The HTTP headers that were received from the server if any.

Implementation
`public function get responseHeaders():Array`

responseURL | property |

`responseURL:String` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The value of the responseURL header, if any.

Implementation
`public function get responseURL():String`

status | property |

`status:int` [read-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The http status code from the server, if any.

Implementation
`public function get status():int`

strand | property |

`strand:IStrand` [write-only]

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Implementation
`public function set strand(value:IStrand):void`

timeout | property |

`timeout:Number`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

A timeout value for server response.

Implementation
`public function get timeout():Number`
`public function set timeout(value:Number):void`

url | property |

`url:String`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The url of the server.

Implementation
`public function get url():String`
`public function set url(value:String):void`
Constructor Detail

HTTPService | () | Constructor

`public function HTTPService()`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Constructor.

Method Detail

addBead | () | method

`public function addBead(bead:IBead):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Add a bead to the strand.

Parameters

| `bead:IBead` — The bead to be added.

completeHandler | () | method |

`protected function completeHandler(event:Event):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The handler for the COMPLETE event.

Parameters

| `event:Event`

getBeadByType | () | method |

`public function getBeadByType(classOrInterface:Class):IBead`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Find a bead on the strand.

Parameters

| `classOrInterface:Class` — The class or interface to use to search for the bead

Returns

| `IBead` — The bead.

ioErrorHandler | () | method |

`protected function ioErrorHandler(event:IOErrorEvent):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The handler for the IO_ERROR event.

Parameters

| `event:IOErrorEvent`

removeBead | () | method |

`public function removeBead(value:IBead):IBead`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Remove a bead from the strand.

Parameters

| `value:IBead` — bead The bead to be removed.

Returns

| `IBead`

send | () | method |

`public function send():void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Sends the headers and contentData to the server.

statusHandler | () | method |

`protected function statusHandler(event:HTTPStatusEvent):void`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

The handler for HTTP_STATUS and/or HTTP_RESPONSE_STATUS events

Parameters

| `event:HTTPStatusEvent`

Event Detail

complete | Event

Event Object Type: `org.apache.flex.events.Event`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Dispatched when the request is complete.

httpResponseStatus | Event |

Event Object Type: `org.apache.flex.events.Event`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Dispatched if Adobe AIR is able to detect and return the status code for the request. Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.

httpStatus | Event |

Event Object Type: `org.apache.flex.events.Event`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Dispatched when an httpStatus code is received from the server.

ioError | Event |

Event Object Type: `org.apache.flex.events.Event`

Language Version : | ActionScript 3.0

Product Version : | FlexJS 0.0

Runtime Versions : | Flash Player 10.2, AIR 2.6

Dispatched if an error occurs in the server communication.

Mon Sep 5 2016, 07:19 AM -07:00