HTTPEncode function
Converts a string into a form that contains no values that are illegal in an HTTP message header.
Unit
Httpapp
Category
HTTP utilities
function HTTPEncode(const AStr: String): string;
Description
HTTPEncode converts all characters in the AStr parameter except for the letters A through Z (and a through z), numerals 0 through 9, the asterisk (*), dollar sign ($), exclamation point (!), at sign (@), period (.), underscore (_), single quote (?, comma (,) parentheses, and hyphen (-). Spaces are converted to plus characters (+), and all other characters are converted into hex values preceded by the percent sign (%).
For example, the string
% ?
is converted into
%%+%3f
HTTPEncode returns the converted string.