Appendix B. Collected ABNF (収集されたABNF)
このセクションには、このドキュメント全体で定義されているすべてのABNF (拡張バッカス・ナウア記法) ルールが収集されています。これらのルールは、HTTPメッセージの構文を形式的に定義します。
BWS = OWS
Connection = 1#connection-option
Content-Length = 1*DIGIT
HTTP-message = start-line
*( header-field CRLF )
CRLF
[ message-body ]
HTTP-name = %x48.54.54.50 ; HTTP
HTTP-version = HTTP-name "/" DIGIT "." DIGIT
Host = uri-host [ ":" port ]
OWS = *( SP / HTAB )
RWS = 1*( SP / HTAB )
TE = #t-codings
Trailer = 1#field-name
Transfer-Encoding = 1#transfer-coding
Upgrade = 1#protocol
Via = 1#( received-protocol RWS received-by [ RWS comment ] )
absolute-URI = scheme ":" hier-part [ "?" query ]
absolute-form = absolute-URI
absolute-path = 1*( "/" segment )
asterisk-form = "*"
authority = [ userinfo "@" ] host [ ":" port ]
authority-form = authority
chunk = chunk-size [ chunk-ext ] CRLF
chunk-data CRLF
chunk-data = 1*OCTET
chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
chunk-ext-name = token
chunk-ext-val = token / quoted-string
chunk-size = 1*HEXDIG
chunked-body = *chunk
last-chunk
trailer-part
CRLF
comment = "(" *( ctext / quoted-pair / comment ) ")"
connection-option = token
ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
field-name = token
field-value = *( field-content / obs-fold )
field-vchar = VCHAR / obs-text
header-field = field-name ":" OWS field-value OWS
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
http-URI = "http://" authority path-abempty [ "?" query ]
[ "#" fragment ]
https-URI = "https://" authority path-abempty [ "?" query ]
[ "#" fragment ]
last-chunk = 1*("0") [ chunk-ext ] CRLF
message-body = *OCTET
method = token
obs-fold = CRLF 1*( SP / HTAB )
obs-text = %x80-FF
origin-form = absolute-path [ "?" query ]
partial-URI = relative-part [ "?" query ]
path-abempty = *( "/" segment )
path-absolute = "/" [ segment-nz *( "/" segment ) ]
path-empty = 0<pchar>
path-rootless = segment-nz *( "/" segment )
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
pct-encoded = "%" HEXDIG HEXDIG
port = *DIGIT
protocol = protocol-name ["/" protocol-version]
protocol-name = token
protocol-version = token
pseudonym = token
qdtext = HTAB / SP / "!" / %x23-5B / %x5D-7E / obs-text
query = *( pchar / "/" / "?" )
quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
rank = ( "0" [ "." 0*3DIGIT ] )
/ ( "1" [ "." 0*3("0") ] )
reason-phrase = *( HTAB / SP / VCHAR / obs-text )
received-by = ( uri-host [ ":" port ] ) / pseudonym
received-protocol = [ protocol-name "/" ] protocol-version
relative-part = "//" authority path-abempty
/ path-absolute
/ path-noscheme
/ path-empty
request-line = method SP request-target SP HTTP-version CRLF
request-target = origin-form
/ absolute-form
/ authority-form
/ asterisk-form
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
segment = *pchar
segment-nz = 1*pchar
start-line = request-line / status-line
status-code = 3DIGIT
status-line = HTTP-version SP status-code SP reason-phrase CRLF
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
t-ranking = OWS ";" OWS "q=" rank
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
/ "+" / "-" / "." / "0"-"9" / "A"-"Z" / "^" / "_"
/ "`" / "a"-"z" / "|" / "~"
token = 1*tchar
trailer-part = *( header-field CRLF )
transfer-coding = "chunked"
/ "compress"
/ "deflate"
/ "gzip"
/ transfer-extension
transfer-extension = token *( OWS ";" OWS transfer-parameter )
transfer-parameter = token BWS "=" BWS ( token / quoted-string )
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
uri-host = host
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
注: これらのABNFルールは、[RFC5234] で定義されている基本ルール (ALPHA、DIGIT、HEXDIG、CRLF、DQUOTE、SP、HTAB、VCHARなど) に依存しています。