MIME

From Fernseher
Revision as of 15:32, 13 January 2009 by 129.42.161.36 (talk)
Jump to navigationJump to search

Need to describe MIME headers and body types here, and what types of MIME bodies can be in multiparts/treed stuff, etc. This is really Entity, probably. Need to be able to distinguish between HTTP and MIME (mail) type entities. Also, an indicator as to whether the entity is currently encoded or decoded. Functions to encode/decode (to MIME transport spec, gzip, compress, etc). When the entity is encoded, it probably shouldn't be writable, if we can enforce that. Should have header access for raw header contents as well as an array of values, with true value, raw value group, and properties array for each value. Should have raw access to the body (including entity bodies, and multipart bodies), as well as split into the entity tree form. Preferably things are only added/changed/removed via the methods or non-raw arrays/hashes, and just viewed in the raw views.

HTTP-Message := HTTP-Request | HTTP-Response
HTTP-Request := request-line  CRLF  entity
HTTP-Response := status-line  CRLF  entity
MIME-Message := entity
entity := headers  CRLF  (body | entity | multipart)
multipart := leader  (CRLF boundary  entity)+  boundary-end  trailer
headers := header*
header := header-name  ':'  header-value  CRLF
header-value := values
values := (value-exp  ',')*  value-exp
value-exp := real-value  (';'  property-exp)*
property-exp := property-key  ['='  property-value]
  • Header comments are in '(' ')' and should not be kept except in the raw header value.
  • Line folding can happen (header line followed by CRLF LWSP extra line).
  • Be careful with cookies.
  • Header contents can have double quoted strings for atoms.