Method Protocols.HTTP.quoted_string_encode()
- Method quoted_string_encode
stringquoted_string_encode(strings)- Description
Encodes the given string quoted to be used as content inside a quoted-string according to RFC 2616 section 2.2. The returned string does not include the surrounding " chars.
- Note
The quoted-string quoting rules in RFC 2616 have several problems:
Quoting is inconsistent since " is quoted as \", but \ does not need to be quoted. This is resolved in the HTTP bis update to mandate quoting of \ too, which this function performs.
Many characters are not quoted sufficiently to make the result safe to use in an HTTP header, so this quoting is not enough if
scontains NUL, CR, LF, or any 8-bit or wider character.
- See also