[manual index][section index]

HTTP0.2(6) -- A sane web protocol is not an oxymoron

SYNOPSIS
I]BI]Less is really more.I]R]

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:

[bu] 2
WebDAV

[bu] 2
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:

[bu] 2
Clients should generate requests that all HTTP 1.1 servers can understand (aside from conventions for directory listing, file creation, etc.)

[bu] 2
Servers should generate replies that all HTTP 1.1 clients can understand.

SUB-STANDARDS
Parts of the HTTP 0.2 standard:

[bu] 2
A simple and sane subset of the URI spec.

[bu] 2
A small subset of the HTTP 1.1 headers and methods.

[bu] 2
A convention on the semantics of actions on directories, to allow file creation/listing/deletion and metadata related operations without using any esoteric features.

[bu] 2
A simplified BNF grammar with sane syntax for things like header.

NIH
[bu] 2
UTF-8 everywhere.

[bu] 2
JSON, might be a good format for representing file metadata and even file manipulation operation commands, perhaps.

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 [oq]features[cq] that should die:

[bu] 2
Cookies.

[bu] 2
Query strings.

[bu] 2
Pipelining.

[bu] 2
Lots of other crud.

OPEN QUESTIONS
[bu] 2
How to handle auth?

[bu] 2
Non TCP transports. STCP?

[bu] 2
Should we define a strict mapping to 9P? What about the lack of stateful semantics?

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

SEE ALSO
[bu] 2
HTTP for servers (http://www.and.org/texts/server-http) - An article by James Antill that looks into some of the issues that make HTTP so hard to implement properly.

[bu] 2
Sam Ruby[cq]s excellent presentation at devcon 2004 (http://intertwingly.net/slides/2004/devcon/9.html) including many of the issues with URLs and HTTP.

[bu] 2
Douglas Crockford[cq]s proposal for fixing HTML (http://www.crockford.com/html/).

[bu] 2
The great thing about URL encodings (http://www.reddit.com/r/programming/comments/bkuu4/the_great_thing_about_url_encodings_is_that_there/) is that there are so many to choose from.

[bu] 2
HTTP cookies, or how not to design protocols (http://lcamtuf.blogspot.com/2010/10/http-cookies-or-how-not-to-design.html).

License
This is part of the TOMO User Manual.

/man/6/http02(6) Rev:  Wed Feb 22 04:14:06 GMT 2023