netkit/http/spec

    Dark Mode
Search:
Group by:

This module contains a few information about HTTP Specification.

Consts

COLON = ':'
  Source Edit
COMMA = ','
  Source Edit
SEMICOLON = ';'
  Source Edit
CR = '\c'
  Source Edit
LF = '\n'
  Source Edit
CRLF = "\c\n"
  Source Edit
SP = ' '
  Source Edit
HTAB = '\t'
  Source Edit
WSP = {' ', '\t'}
  Source Edit

Procs

proc checkFieldName(s: string) {...}{.raises: [ValueError], tags: [].}

Checks if s is a valid name of a HTTP header field.

HTTP RFC 5234

DIGIT          =  %x30-39            ; 0-9
ALPHA          =  %x41-5A / %x61-7A  ; A-Z / a-z

HTTP RFC 7230

field-name     =  token
token          =  1*tchar
tchar          =  "!" / "#" / "$" / "%" / "&" / "'" / "*"
               /  "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
               /  DIGIT
               /  ALPHA
               ;  any VCHAR, except delimiters
  Source Edit
proc checkFieldValue(s: string) {...}{.raises: [ValueError], tags: [].}

Checks if s is a valid value of a HTTP header field.

HTTP RFC 5234

HTAB           =  %x09       ; horizontal tab
SP             =  %x20       ; ' '
VCHAR          =  %x21-7E    ; visible (printing) characters

HTTP RFC 7230

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