HttpHeaders
##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: BoolTell 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(): HttpHeadersDeep copy of the HttpHeaders
| Returns |
|---|
| HttpHeaders |
finalise(): VoidMake this instance immutable
NOTE: This method is called automatically once the HttpRequest instance, which handle this HttpHeaders instance, is sent
keys(): IteratorIterator on headers
Use example: for (key in instance.keys)
| Returns |
|---|
| Iterator |
Check if an header exists
| Name | Type |
|---|---|
key |
String |
| Returns |
|---|
| Bool |
Get an header value from its key (or "" if no header)
| Name | Type |
|---|---|
key |
String |
| Returns |
|---|
| String |
add(key: String, value: String): HttpHeadersAdd 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): HttpHeadersRemove an header and its value from the instance
| Name | Type |
|---|---|
key |
String |
| Returns |
|---|
| HttpHeaders |
Class instance
| Name | Type | Default | Description |
|---|---|---|---|
headers |
Dynamic | null |
Accept an Anonymous Structure (ie:{'Pragma':'no-cache'}) or an HttpHeaders instance |