- RFC 2616
-
- Message:
-
- HTTP-message = Request | Response
-
- generic-message = start-line
- *(message-header CRLF)
- CRLF
- [ message-body ]
-
- start-line = Request-Line | Status-Line
-
- message-header = field-name ":" [ field-value ]
- field-name = token
- field-value = *( field-content | LWS )
- field-content = <the OCTETs making up the field-value and consisting of either *TEXT or combinations of token, separators, and quoted-string>
-
- message-body = entity-body
- | <entity-body encoded as per Transfer-Encoding>
- general-header = Cache-Control
- | Connection
- | Date
- | Pragma
- | Trailer
- | Transfer-Encoding
- | Upgrade
- | Via
- | Warning
-
-
- Request:
-
- Request = Request-Line
- *(( general-header
- | request-header
- | entity-header ) CRLF)
- CRLF
- [ message-body ]
-
- Request-Line = Method SP Request-URI SP HTTP-Version CRLF
-
- Method = "OPTIONS"
- | "GET"
- | "HEAD"
- | "POST"
- | "PUT"
- | "DELETE"
- | "TRACE"
- | "CONNECT"
- | extension-method
-
- extension-method = token
-
- Request-URI = "*" | absoluteURI | abs_path | authority
- absoluteURI = scheme ":" ( hier_part | opaque_part )
- scheme = alpha *( alpha | digit | "+" | "-" | "." )
- hier_part = ( net_path | abs_path ) [ "?" query ]
- opaque_part = uric_no_slash *uric
- net_path = "//" authority [ abs_path ]
- abs_path = "/" path_segments
- query = *uric
- uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- uric = reserved | unreserved | escaped
- authority = server | reg_name
- path_segments = segment *( "/" segment )
- unreserved = alphanum | mark
- escaped = "%" hex hex
- reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- server = [ [ userinfo "@" ] hostport ]
- reg_name = 1*( unreserved | escaped | "$" | "," | ";" | ":" | "@" | "&" | "=" | "+" )
- segment = *pchar *( ";" param )
- mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
- userinfo = *( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," )
- hostport = host [ ":" port ]
- pchar = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | ","
- param = *pchar
- host = hostname | IPv4address
- port = *digit
- hostname = *( domainlabel "." ) toplabel [ "." ]
- IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
- domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- toplabel = alpha | alpha *( alphanum | "-" ) alphanum
- alphanum = alpha | digit
- alpha = lowalpha | upalpha
- lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" |
- "w" | "x" | "y" | "z"
- upalpha = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" |
- "W" | "X" | "Y" | "Z"
- digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
-
- request-header = Accept
- | Accept-Charset
- | Accept-Encoding
- | Accept-Language
- | Authorization
- | Expect
- | From
- | Host
- | If-Match
- | If-Modified-Since
- | If-None-Match
- | If-Range
- | If-Unmodified-Since
- | Max-Forwards
- | Proxy-Authorization
- | Range
- | Referer
- | TE
- | User-Agent
-
-
- Response:
-
- Response = Status-Line
- *(( general-header
- | response-header
- | entity-header ) CRLF)
- CRLF
- [ message-body ]
-
- Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
-
- Status-Code = "100"
- | "101"
- | "200"
- | "201"
- | "202"
- | "203"
- | "204"
- | "205"
- | "206"
- | "300"
- | "301"
- | "302"
- | "303"
- | "304"
- | "305"
- | "307"
- | "400"
- | "401"
- | "402"
- | "403"
- | "404"
- | "405"
- | "406"
- | "407"
- | "408"
- | "409"
- | "410"
- | "411"
- | "412"
- | "413"
- | "414"
- | "415"
- | "416"
- | "417"
- | "500"
- | "501"
- | "502"
- | "503"
- | "504"
- | "505"
- | extension-code
-
- extension-code = 3DIGIT
- Reason-Phrase = *<TEXT, excluding CR, LF>
-
- response-header = Accept-Ranges
- | Age
- | ETag
- | Location
- | Proxy-Authenticate
- | Retry-After
- | Server
- | Vary
- | WWW-Authenticate
-
- entity-header = Allow
- | Content-Encoding
- | Content-Language
- | Content-Length
- | Content-Location
- | Content-MD5
- | Content-Range
- | Content-Type
- | Expires
- | Last-Modified
- | extension-header
-
- extension-header = message-header
-
- entity-body = *OCTET
-
- entity-body := Content-Encoding( Content-Type( data ) )
-
-
-