[Web-SIG] Re: Latest WSGI Draft (Phillip J. Eby)

Ian Bicking ianb at colorstudy.com
Wed Aug 25 08:25:33 CEST 2004

Phillip J. Eby wrote:
> Hm.  Looking at 'email.Message', actually, it has all the semantics 
> needed for header management, and it looks like the interface at least 
> is stable across 2.2 and 2.3 (I haven't checked 2.4.)
> The code is relatively brief, and I think I'd be okay with using it as 
> the type for 'headers'.  Anybody have any objections?  Here's sample usage:
>     from email.Message import Message
>     def application(env, start):
>         headers = Message()
>         headers.set_type("text/plain")
>         headers.add_header("Set-Cookie", "CUSTOMER=WILE_E_COYOTE", 
> path="/foobar")
>         start("200 OK", headers)("Hello world!")
> One of the nice things about it is that it makes it easier to do MIME 
> and HTTP headers that have parameter info.

Seems like an appropriate object.  This part certainly should be stable, 
since they are deprecating mimetools and rfc822, with email replacing those.

At first it seemed a little annoying that content-type was handled 
differently, but because it's the one required header it actually seems 
pretty reasonable.

It seems like there are a couple things that are a little inappropriate 
for HTTP: multipart, unifrom, attach, payload, filename, boundary, 
preamble, epilogue.

Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org

More information about the Web-SIG mailing list