class com.akifox.asynchttp.HttpHeaders

Available on all platforms

HttpHeaders

This class represents an Http header collection and it is used by the library to handle HTTP Headers

@repo akifox-asynchttp repository

@author Simone Cingano (yupswing) Akifox Studio

@licence MIT Licence

Instance Fields

var finalised:Bool

Tell if the instance is immutable

NOTE: The only way to change an immutable instance is copying it (instance.clone()) and change the copy

function new(?headers:Dynamic = null):Void

Class instance

headers

Accept an Anonymous Structure (ie: {'Pragma':'no-cache'}) or an HttpHeaders instance

function add(key:String, value:String):HttpHeaders

Add an header and its value to the instance

NOTE: If already present the header will be overwritten

function clone():HttpHeaders

Deep copy of the HttpHeaders

returns

A new HttpHeaders

function exists(key:String):Bool

Check if an header exists

function finalise():Void

Make this instance immutable

NOTE: This method is called automatically once the HttpRequest instance, which handle this HttpHeaders instance, is sent

function get(key:String):String

Get an header value from its key (or "" if no header)

function keys():Iterator<String>

Iterator on headers

Use example: for (key in instance.keys)

function remove(key:String):HttpHeaders

Remove an header and its value from the instance

function toString():String

returns

Debug representation of the HttpHeaders instance