Available on flash
new(url:String)
cancel():Void
Cancels this Http request if request has been called and a response has not yet been received.
this
request
read onlyresponseData:Null<String>
url:String
The url of this request. It is used only by the request() method and can be changed in order to send the same request to different target Urls.
request()
addHeader(header:String, value:String):Void
addParameter(name:String, value:String):Void
dynamiconData(data:String):Void
This method is called upon a successful request, with data containing the result String.
data
The intended usage is to bind it to a custom function: httpInstance.onData = function(data) { // handle result }
httpInstance.onData = function(data) { // handle result }
dynamiconError(msg:String):Void
This method is called upon a request error, with msg containing the error description.
msg
The intended usage is to bind it to a custom function: httpInstance.onError = function(msg) { // handle error }
httpInstance.onError = function(msg) { // handle error }
dynamiconStatus(status:Int):Void
This method is called upon a Http status change, with status being the new status.
status
The intended usage is to bind it to a custom function: httpInstance.onStatus = function(status) { // handle status }
httpInstance.onStatus = function(status) { // handle status }
setHeader(name:String, value:String):Void
Sets the header identified as header to value value.
header
value
If header or value are null, the result is unspecified.
This method provides a fluent interface.
setParameter(name:String, value:String):Void
Sets the parameter identified as param to value value.
param
setPostData(data:String):Void
Sets the post data of this Http request to data.
There can only be one post data per request. Subsequent calls overwrite the previously set value.
If data is null, the post data is considered to be absent.