Static variables

@:value(null)staticPROXY:{port:Int, host:String, auth:{user:String, pass:String}} = null

Static methods

staticrequestUrl(url:String):String

Makes a synchronous request to url.

This creates a new Http instance and makes a GET request by calling its request(false) method.

If url is null, the result is unspecified.

Constructor

new(url:String)

Variables

Methods

customRequest(post:Bool, api:Output, ?sock:Socket, ?method:String):Void

@:value({ mimeType : "application/octet-stream" })fileTransfer(argname:String, filename:String, file:Input, size:Int, mimeType:String = "application/octet-stream"):Void

getResponseHeaderValues(key:String):Null<Array<String>>

Returns an array of values for a single response header or returns null if no such header exists. This method can be useful when you need to get a multiple headers with the same name (e.g. Set-Cookie), that are unreachable via the responseHeaders variable.

Inherited Variables

Defined by HttpBase

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.

Inherited Methods

Defined by HttpBase

addHeader(header:String, value:String):Void

dynamiconBytes(data:Bytes):Void

This method is called upon a successful request, with data containing the result String.

The intended usage is to bind it to a custom function: httpInstance.onBytes = function(data) { // handle result }

dynamiconData(data:String):Void

This method is called upon a successful request, with data containing the result String.

The intended usage is to bind it to a custom function: httpInstance.onData = function(data) { // handle result }

dynamiconError(msg:String):Void

This method is called upon a request error, with msg containing the error description.

The intended usage is to bind it to a custom function: 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.

The intended usage is to bind it to a custom function: httpInstance.onStatus = function(status) { // handle status }

setHeader(name:String, value:String):Void

Sets the header identified as name to value value.

If name 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 name to value value.

If name or value are null, the result is unspecified.

This method provides a fluent interface.

setPostBytes(data:Null<Bytes>):Void

Sets the post data of this Http request to data bytes.

There can only be one post data per request. Subsequent calls to this method or to setPostData() overwrite the previously set value.

If data is null, the post data is considered to be absent.

This method provides a fluent interface.

setPostData(data:Null<String>):Void

Sets the post data of this Http request to data string.

There can only be one post data per request. Subsequent calls to this method or to setPostBytes() overwrite the previously set value.

If data is null, the post data is considered to be absent.

This method provides a fluent interface.