HTTP 0.2 -- A sane web protocol is not an oxymoron

SYNOPSIS

Less is really more.

A minimalist and sane subset of HTTP that maps well to 9P(7) and encompasses the best RESTful practices.

FORWARD

GOALS

While being simpler than HTTP 1.1 by ignoring all the unused and clunky bits, define conventions that would allow us to replace most of the functionality of:

  • WebDAV
  • AtomPub

Should be possible to implement a server using existing frameworks, eg., CGI. Writing new implementations from scratch should be trivial without depending on any external library.

Backwards compatibility:

  • Clients should generate requests that all HTTP 1.1 servers can understand (aside from conventions for directory listing, file creation, etc.)
  • Servers should generate replies that all HTTP 1.1 clients can understand.

SUB-STANDARDS

Parts of the HTTP 0.2 standard:

  • A simple and sane subset of the URI spec.
  • A small subset of the HTTP 1.1 headers and methods.
  • A convention on the semantics of actions on directories, to allow file creation/listing/deletion and metadata related operations without using any esoteric features.
  • A simplified BNF grammar with sane syntax for things like header.

NIH

  • UTF-8 everywhere.
  • JSON or bencode might be a good format for representing file metadata and even file manipulation operation commands.

THINGS WE SHOULD TRY TO AVOID

We should only define new headers if no alternative is possible.

THINGS WE MUST KILL (IF WE CAN)

This is a wishlist of horribly complex and mostly useless HTTP ‘features’ that should die:

  • Cookies.
  • Query strings.
  • Pipelining.
  • Lots of other crud.

OPEN QUESTIONS

  • How to handle auth?
  • Non TCP transports. STCP?
  • Should we define a strict mapping to 9P? What about the lack of stateful semantics?

SPECIFICATION

GRAMMAR

<request> ::= <method> <request-headers> <opt-body>
<response> ::= <result> <response-headers> <opt-body>
  <result> ::= <version> <status-message> <EOL>
  <method> ::= <verb> <resource> <version> <EOL>
    <version> ::= "HTTP/0.2"
    <status-message> ::= "200 OK"
                       | "204 No Content"
                       | "303 See Other"
                       | "304 Not Modified"
                       | "400 Bad Request"
                       | "401 Unauthorized"
                       | "404 Not Found"
                       | "420 Enhance Your Calm"
                       | "500 Internal Server Error"
                       | "503 Service Unavailable"
                       | "505 HTTP Version Not Supported"
    <verb> ::= "GET" | "POST" | "DELETE" | "OPTIONS"
  <request-headers> ::= <request-header> <EOL>
                      | <request-header> <EOL> <request-headers>
  <response-headers> ::= <response-header> <EOL>
                       | <response-header> <EOL> <response-headers>
    <request-header> ::= "Accept: " <content-type>
                       | "Authorization: " <token>
                       | "Content-Length: " <octet-count>
                       | "Content-Type: " <content-type>
                       | "Date: " <http-date>
                       | "Host: " <host-name>
                       | "If-Modified-Since: " <http-date>
                       | "Origin: " <uri>
                       | "Range: bytes=" <start> "-" <end>
    <response-header> ::= "Access-Control-Allow-Origin: " <uri-or-*>
                        | "Content-Length: " <octet-count>
                        | "Content-Range: bytes " <start> "-" <end>
                        | "Content-Type: " <content-type>
                        | "Date: " <http-date>
                        | "Expires: " <http-date>
                        | "Location: " <uri>
                        | "WWW-Authenticate: " <authentication-scheme>
      <http-date> ::= <date> " " <time> " " <time-zone>
        <date> ::= <day-of-week> ", " <day> " " <month> " " <year>
          <day-of-week> ::= "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat"
                          | "Sun"
          <day> ::= "00" | "01" | "02" | "03" | "04" | "05" | "06" | "07"
                  | "08" | "09" | "10" | "11" | "12" | "13" | "14" | "15"
                  | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23"
                  | "24" | "25" | "26" | "27" | "28" | "29" | "30" | "31"
          <month> ::= "Jan" | "Feb" | "Mar" | "Jun" | "Jul" | "Aug"
                    | "Sep" | "Oct" | "Nov" | "Dec"
          <year> ::= <digits>
        <time> ::= <hour> ":" <minute> ":" <second>
          <hour> ::= "00" | "01" | "02" | "03" | "04" | "05" | "06" | "07"
                   | "08" | "09" | "10" | "11" | "12" | "13" | "14" | "15"
                   | "16" | "17" | "18" | "19" | "20" | "21" | "22" | "23"
          <minute> ::= <sixty-ticks>
          <second> ::= <sixty-ticks>
          <sixty-ticks> ::= "00" | "01" | "02" | "03" | "04" | "05" | "06"
                          | "07" | "08" | "09" | "10" | "11" | "12" | "13"
                          | "14" | "15" | "16" | "17" | "18" | "19" | "20"
                          | "21" | "22" | "23" | "24" | "25" | "26" | "27"
                          | "28" | "29" | "30" | "31" | "32" | "33" | "34"
                          | "35" | "36" | "37" | "38" | "39" | "40" | "41"
                          | "42" | "43" | "44" | "45" | "46" | "47" | "49"
                          | "50" | "51" | "52" | "53" | "54" | "55" | "56"
                          | "57" | "58" | "59"
        <time-zone> ::= "GMT"
  <host-name> ::= <labels>
    <labels> ::= <label> | <label> "." <labels>
      <label> ::= <characters>
  <resource> ::= "/" <directory-list> <file-name>
    <directory-list> ::= <directory> | <directory> <directory-list>
      <file-name> ::= <characters> | <characters> "." <characters>
      <directory> ::= <file-name> "/"
  <uri> ::= "http://" <host-name> <resource>
  <uri-or-*> ::= <uri> | "*"
  <characters> ::= <character> | <character> <characters>
    <label> ::= <letter> | <digit> | <hyphen>
      <letter> ::= "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"
      <hyphen> ::= "-"
  <opt-body> ::= <body> | ""

SEE ALSO

results matching ""

    No results matching ""