Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 211 lines (211 sloc) 10.151 kb
97e3d82e »
2010-10-02 add an HTTP ABNF, derived from RFC2068
1 LWS = [CRLF] 1*( SP / HTAB )
2 tspecials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / DQUOTE / "/" / "[" / "]" / "?" / "=" / "{" / "}" / SP / HTAB
3 token = 1*<any CHAR except CTL / tspecials >
4 comment = "(" *( ctext / comment ) ")"
5 ctext = <any TEXT except "(" / ")">
6 quoted-string = ( DQUOTE *( qdtext ) DQUOTE )
7 qdtext = <any TEXT except DQUOTE>
8 quoted-pair = "\" CHAR
9 HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
10 URI = ( absoluteURI / relativeURI ) ["#" fragment]
11 absoluteURI = scheme ":" *( uchar / reserved )
12 relativeURI = net_path / abs_path / rel_path
13 net_path = "//" net_loc [abs_path]
14 abs_path = "/" rel_path
15 rel_path = [path] [";" params] ["?" query]
16 path = fsegment *( "/" segment )
17 fsegment = 1*pchar
18 segment = *pchar
19 params = param *( ";" param )
20 param = *( pchar / "/" )
21 scheme = 1*( ALPHA / DIGIT / "+" / "-" / "." )
22 net_loc = *( pchar / ";" / "?" )
23 query = *( uchar / reserved )
24 fragment = *( uchar / reserved )
25 pchar = uchar / ":" / "@" / "&" / "=" / "+"
26 uchar = unreserved / escape
27 unreserved = ALPHA / DIGIT / safe / extra / national
28 escape = "%" HEXDIGIT HEXDIGIT
29 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
30 extra = "!" / "*" / "'" / "(" / ")" / ","
31 safe = "$" / "-" / "_" / "."
32 unsafe = CTL / SP / DQUOTE / "#" / "%" / "<" / ">"
33 national = <any OCTET except ALPHA / DIGIT / reserved / extra / safe / unsafe>
34 http_URL = "http:" "//" host [":" port] [abs_path]
35 host = <any OCTET except ":" / "/">
36 port = *DIGIT
37 HTTP-date = rfc1123-date / rfc850-date / asctime-date
38 rfc1123-date = wkday "," SP date1 SP time SP "GMT"
39 rfc850-date = weekday "," SP date2 SP time SP "GMT"
40 asctime-date = wkday SP date3 SP time SP 4DIGIT
41 date1 = 2DIGIT SP month SP 4DIGIT
42 date2 = 2DIGIT "-" month "-" 2DIGIT
43 date3 = month SP ( 2DIGIT / ( SP 1DIGIT ) )
44 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
45 wkday = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
46 weekday = "Monday" / "Tuesday" / "Wednesday" / "Thursday" / "Friday" / "Saturday" / "Sunday"
47 month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
48 delta-seconds = 1*DIGIT
49 charset = token
50 content-coding = token
51 transfer-coding = "chunked" / transfer-extension
52 transfer-extension = token
53 Chunked-Body = *chunk "0" CRLF footer CRLF
54 chunk = chunk-size [chunk-ext] CRLF chunk-data CRLF
55 hex-no-zero = <any HEXDIGIT except "0">
56 chunk-size = hex-no-zero *HEXDIGIT
57 chunk-ext = *( ";" chunk-ext-name ["=" chunk-ext-value] )
58 chunk-ext-name = token
59 chunk-ext-value = token / quoted-string
60 chunk-data = chunk-size ( OCTET )
61 footer = *entity-header
62 media-type = type "/" subtype *( ";" parameter )
63 type = token
64 subtype = token
65 parameter = attribute "=" value
66 attribute = token
67 value = token / quoted-string
68 product = token ["/" product-version]
69 product-version = token
70 qvalue = ( "0" ["." 0*3DIGIT] ) / ( "1" ["." 0*3( "0" )] )
71 language-tag = primary-tag *( "-" subtag )
72 primary-tag = 1*8ALPHA
73 subtag = 1*8ALPHA
74 entity-tag = [weak] opaque-tag
75 weak = "W/"
76 opaque-tag = quoted-string
77 range-unit = bytes-unit / other-range-unit
78 bytes-unit = "bytes"
79 other-range-unit = token
80 HTTP-message = Request / Response
81 generic-message = start-line *message-header CRLF [message-body]
82 start-line = Request-Line / Status-Line
83 message-header = field-name ":" [field-value] CRLF
84 field-name = token
85 field-value = *( field-content / LWS )
86 field-content = <any OCTET except LWS>
87 message-body = entity-body
88 general-header = Cache-Control / Connection / Date / Pragma / Transfer-Encoding / Upgrade / Via
89 Request = Request-Line / *( general-header / request-header / entity-header ) CRLF [message-body]
90 Request-Line = Method SP Request-URI SP HTTP-Version CRLF
91 Method = "OPTIONS" / "GET" / "HEAD" / "POST" / "PUT" / "DELETE" / "TRACE" / extension-method
92 extension-method = token
93 Request-URI = "*" / absoluteURI / abs_path
94 request-header = Accept / Accept-Charset / Accept-Encoding / Accept-Language / Authorization / From / Host / If-Modified-Since / If-Match / If-None-Match / If-Range / If-Unmodified-Since / Max-Forwards / Proxy-Authorization / Range / Referer / User-Agent
95 Response = Status-Line *( general-header / response-header / entity-header ) CRLF [message-body]
96 Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
97 Status-Code = 3DIGIT
98 Reason-Phrase = *<any TEXT except CR / LF>
99 response-header = Age / Location / Proxy-Authenticate / Public / Retry-After / Server / Vary / Warning / WWW-Authenticate / MIME-Version / Content-Version / Derived-From / Link
100 entity-header = Allow / Content-Base / Content-Encoding / Content-Language / Content-Length / Content-Location / Content-MD5 / Content-Range / Content-Type / ETag / Expires / Last-Modified / extension-header
101 extension-header = message-header
102 entity-body = *OCTET
103 auth-scheme = token
104 auth-param = token "=" quoted-string
105 challenge = auth-scheme 1*SP realm *( "," auth-param )
106 realm = "realm" "=" realm-value
107 realm-value = quoted-string
108 credentials = basic-credentials / auth-scheme #auth-param
109 basic-credentials = "Basic" SP basic-cookie
110 base64 = *(4base64-char) [base64-terminal]
111 base64-char = ALPHA / DIGIT / "+" / "/"
112 base64-terminal = (2base64-char "==") / (3base64-char "=")
113 basic-cookie = base64
114 user-pass = userid ":" password
115 userid = *<any TEXT except ":">
116 password = *TEXT
117 Accept = "Accept" ":" #( media-range [accept-params] )
118 media-range = ( "*/*" / ( type "/" "*" ) / ( type "/" subtype ) ) *( ";" parameter )
119 accept-params = ";" "q" "=" qvalue *( accept-extension )
120 accept-extension = ";" token ["=" ( token / quoted-string )]
121 Accept-Charset = "Accept-Charset" ":" 1#( charset [";" "q" "=" qvalue] )
122 Accept-Encoding = "Accept-Encoding" ":" #( content-coding )
123 Accept-Language = "Accept-Language" ":" 1#( language-range [";" "q" "=" qvalue] )
124 language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) / "*" )
125 Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges
126 acceptable-ranges = 1#range-unit / "none"
127 Age = "Age" ":" age-value
128 age-value = delta-seconds
129 Allow = "Allow" ":" 1#Method
130 Authorization = "Authorization" ":" credentials
131 Cache-Control = "Cache-Control" ":" 1#cache-directive
132 cache-directive = cache-request-directive / cache-response-directive
133 cache-request-directive = "no-cache" ["=" DQUOTE 1#field-name DQUOTE] / "no-store" / "max-age" "=" delta-seconds / "max-stale" ["=" delta-seconds] / "min-fresh" "=" delta-seconds / "only-if-cached" / cache-extension
134 cache-response-directive = "public" / "private" ["=" DQUOTE 1#field-name DQUOTE] / "no-cache" ["=" DQUOTE 1#field-name DQUOTE] / "no-store" / "no-transform" / "must-revalidate" / "proxy-revalidate" / "max-age" "=" delta-seconds / cache-extension
135 cache-extension = token ["=" ( token / quoted-string )]
136 Connection = Connection-header
137 Connection-header = "Connection" ":" 1#( connection-token )
138 connection-token = token
139 Content-Base = "Content-Base" ":" absoluteURI
140 Content-Encoding = "Content-Encoding" ":" 1#content-coding
141 Content-Language = "Content-Language" ":" 1#language-tag
142 Content-Length = "Content-Length" ":" 1*DIGIT
143 Content-Location = "Content-Location" ":" ( absoluteURI / relativeURI )
144 Content-MD5 = "Content-MD5" ":" md5-digest
145 md5-digest = base64
146 Content-Range = "Content-Range" ":" content-range-spec
147 content-range-spec = byte-content-range-spec
148 byte-content-range-spec = bytes-unit SP first-byte-pos "-" last-byte-pos "/" entity-length
149 entity-length = 1*DIGIT
150 Content-Type = "Content-Type" ":" media-type
151 Date = "Date" ":" HTTP-date
152 ETag = "ETag" ":" entity-tag
153 Expires = "Expires" ":" HTTP-date
154 From = "From" ":" mailbox
155 mailbox = TEXT
156 Host = "Host" ":" host [":" port]
157 If-Modified-Since = "If-Modified-Since" ":" HTTP-date
158 If-Match = "If-Match" ":" ( "*" / 1#entity-tag )
159 If-None-Match = "If-None-Match" ":" ( "*" / 1#entity-tag )
160 If-Range = "If-Range" ":" ( entity-tag / HTTP-date )
161 If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
162 Last-Modified = "Last-Modified" ":" HTTP-date
163 Location = "Location" ":" absoluteURI
164 Max-Forwards = "Max-Forwards" ":" 1*DIGIT
165 Pragma = "Pragma" ":" 1#pragma-directive
166 pragma-directive = "no-cache" / extension-pragma
167 extension-pragma = token ["=" ( token / quoted-string )]
168 Proxy-Authenticate = "Proxy-Authenticate" ":" challenge
169 Proxy-Authorization = "Proxy-Authorization" ":" credentials
170 Public = "Public" ":" 1#Method
171 ranges-specifier = byte-ranges-specifier
172 byte-ranges-specifier = bytes-unit "=" byte-range-set
173 byte-range-set = 1#( byte-range-spec / suffix-byte-range-spec )
174 byte-range-spec = first-byte-pos "-" [last-byte-pos]
175 first-byte-pos = 1*DIGIT
176 last-byte-pos = 1*DIGIT
177 suffix-byte-range-spec = "-" suffix-length
178 suffix-length = 1*DIGIT
179 Range = "Range" ":" ranges-specifier
180 Referer = "Referer" ":" ( absoluteURI / relativeURI )
181 Retry-After = "Retry-After" ":" ( HTTP-date / delta-seconds )
182 Server = "Server" ":" 1*( product / comment )
183 Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding
184 Upgrade = "Upgrade" ":" 1#product
185 User-Agent = "User-Agent" ":" 1*( product / comment )
186 Vary = "Vary" ":" ( "*" / 1#field-name )
187 Via = "Via" ":" 1#( received-protocol received-by [comment] )
188 received-protocol = [protocol-name "/"] protocol-version
189 protocol-name = token
190 protocol-version = token
191 received-by = ( host [":" port] ) / pseudonym
192 pseudonym = token
193 Warning = "Warning" ":" 1#warning-value
194 warning-value = warn-code SP warn-agent SP warn-text
195 warn-code = 2DIGIT
196 warn-agent = ( host [":" port] ) / pseudonym
197 warn-text = quoted-string
198 WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge
199 MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
200 Content-Version = "Content-Version" ":" quoted-string
201 Derived-From = "Derived-From" ":" quoted-string
202 Link = "Link" ":" #( "<" URI ">" *( ";" link-param ) )
203 link-param = ( ( "rel" "=" relationship ) / ( "rev" "=" relationship ) / ( "title" "=" quoted-string ) / ( "anchor" "=" DQUOTE URI DQUOTE ) / ( link-extension ) )
204 link-extension = token ["=" ( token / quoted-string )]
205 relationship = sgml-name / ( DQUOTE sgml-name *( SP sgml-name ) DQUOTE )
206 sgml-name = ALPHA *( ALPHA / DIGIT / "." / "-" )
207 URI-header = "URI" ":" 1#( "<" URI ">" )
208 Keep-Alive-header = "Keep-Alive" ":" 0#keepalive-param
209 keepalive-param = param-name "=" value
210 param-name = *TEXT
d05b7441 »
2010-10-29 Add the TEXT rule in the HTTP ABNF spec
211 TEXT = <any OCTET except CTL>
Something went wrong with that request. Please try again.