HttpHeaders

com.akifox.asynchttp.HttpHeaders (Class)

##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

Static Members

Instance Members

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


toString(): String
Returns
String

clone(): HttpHeaders

Deep copy of the HttpHeaders

Returns
HttpHeaders

finalise(): Void

Make this instance immutable

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


keys(): Iterator

Iterator on headers

Use example: for (key in instance.keys)

Returns
Iterator

exists(key: String): Bool

Check if an header exists

Name Type
key String
Returns
Bool

get(key: String): String

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

Name Type
key String
Returns
String

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

Add an header and its value to the instance

NOTE: If already present the header will be overwritten

Name Type
key String
value String
Returns
HttpHeaders

remove(key: String): HttpHeaders

Remove an header and its value from the instance

Name Type
key String
Returns
HttpHeaders

new(?headers: Dynamic = null): Void

Class instance

Name Type Default Description
headers Dynamic null Accept an Anonymous Structure (ie:{'Pragma':'no-cache'}) or an HttpHeaders instance

Private Members

FORBIDDEN_ON_REQUEST: Array<String>