这个模块包含 HTTP 规范相关的一些信息。
Procs
proc checkFieldName(s: string) {...}{.raises: [ValueError], tags: [].}
-
检查 s 是否为有效的 HTTP 头字段名称。
DIGIT = %x30-39 ; 0-9 ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
field-name = token token = 1*tchar tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA ; any VCHAR, except delimiters
Source Edit proc checkFieldValue(s: string) {...}{.raises: [ValueError], tags: [].}
-
检查 s 是否为有效的 HTTP 头字段值。
HTAB = %x09 ; horizontal tab SP = %x20 ; ' ' VCHAR = %x21-7E ; visible (printing) characters
field-value = \*( field-content / obs-fold ) field-content = field-vchar [ 1\*( SP / HTAB ) field-vchar ] field-vchar = VCHAR / obs-text obs-text = %x80-FF obs-fold = CRLF 1\*( SP / HTAB ) ; obsolete line folding
Source Edit