cfboom.http.HttpMessage
HTTP messages head consisting of multiple message headers.
Method Summary | |
---|---|
void
|
addHeader([string name], [string value])
Adds a header to this message. |
boolean
|
containsHeader([string name])
Checks if a certain header is present in this message. |
array
|
getAllHeaders()
Returns all the headers of this message. |
string
|
getContentEncoding()
Obtains the Content-Encoding header, if known. |
numeric
|
getContentLength()
Tells the length of the content, if known. |
string
|
getContentType()
Obtains the Content-Type header, if known. |
string
|
getFirstHeader([string name])
Returns the first header with a specified name of this message. |
array
|
getHeaders([string name])
Returns all the headers with a specified name of this message. |
string
|
getLastHeader([string name])
Returns the last header with a specified name of this message. |
void
|
removeHeaders([string name])
Removes all headers with a certain name from this message. |
void
|
setHeader([string name], [string value])
Overwrites the first header with the same name. |
void
|
setHeaders([array headers])
Overwrites all the headers in the message. |
Method Detail |
---|
Adds a header to this message. The header will be appended to the end of the list.
name
- the name of the header.value
- the value of the header.Checks if a certain header is present in this message. Header values are ignored.
name
Returns all the headers of this message. Headers are orderd in the sequence they will be sent over a connection.
Obtains the Content-Encoding header, if known. This is the header that should be used when sending the entity, or the one that was received with the entity. Wrapping entities that modify the content encoding should adjust this header accordingly. {@code null} if the content encoding is unknown
Tells the length of the content, if known. a negative number if unknown. If the content length is known but exceeds {@link java.lang.Long#MAX_VALUE Long.MAX_VALUE}, a negative number is returned.
Obtains the Content-Type header, if known. This is the header that should be used when sending the entity, or the one that was received with the entity. It can include a charset attribute. {@code null} if the content type is unknown
Returns the first header with a specified name of this message. Header values are ignored. If there is more than one matching header in the message the first element of {@link #getHeaders(String)} is returned. If there is no matching header in the message {@code null} is returned. or {@code null} if no such header could be found.
name
Returns all the headers with a specified name of this message. Header values are ignored. Headers are orderd in the sequence they will be sent over a connection.
name
Returns the last header with a specified name of this message. Header values are ignored. If there is more than one matching header in the message the last element of {@link #getHeaders(String)} is returned. If there is no matching header in the message {@code null} is returned. or {@code null} if no such header could be found.
name
Removes all headers with a certain name from this message.
name
- The name of the headers to remove.Overwrites the first header with the same name. The new header will be appended to the end of the list, if no header with the given name can be found.
name
- the name of the header.value
- the value of the header.Overwrites all the headers in the message.
headers
- the array of headers to set.