
IF_HTTP_UTILITY
Definition
This interface provides general methods that can be used for HTTP data. They are not client- or server-specific.
Structure
There are the following methods for processing HTTP data:
|
DECODE_BASE64 |
Decodes a Base64-encoded string. |
|
ENCODE_BASE64 |
Encodes a Base64 |
|
ESCAPE_HTML |
Converts all letters in a string that could be interpreted as a HTML control sequence in a HTML page. The conversion ensures that they are output correctly. A typical example is the ‘<’ character. This character could be interpreted as the beginning of a HTML tag. It is therefore converted to the character sequence '<', which the browser interprets as '<'. |
|
ESCAPE_URL |
Replaces with '%xx' symbols in a string that could be URL control characters. ‘xx’ is the hex code of the character. Also, spaces are replaced by '+' characters. Strings that have been thus changed are later processed to become URLs . For example, the string 'Tom & Jerry' becomes 'Tom+%26+Jerry'. |
|
UNESCAPE_URL |
Opposite of ESCAPE_URL. Converts the characters back to URL control characters (for example, the query string part of a URL) and returns the resulting string. |
|
GET_LAST_ERROR |
Returns the last error code. |
|
STRING_TO_FIELDS |
Decodes a query string into a list of fields. |
|
FIELDS_TO_STRING |
Encodes a list of fields as a query string. |
Integration
In some cases, the same methods are implemented in different interfaces (such as
IF_HTTP_SERVER, IF_HTTP_ENTITY). In the long term, all general HTTP tools should be collected into this interface.
Use the IF_HTTP_UTILITY methods, even if the same methods are implemented in other interfaces.