[Web-SIG] Re: Latest WSGI Draft (Phillip J. Eby)
Phillip J. Eby
pje at telecommunity.com
Wed Aug 25 17:55:39 CEST 2004
At 01:25 AM 8/25/04 -0500, Ian Bicking wrote:
>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.
Actually, there's nothing stopping you from using the normal features to
manipulate content-type; but 'set_type()' is more convenient.
>It seems like there are a couple things that are a little inappropriate
>for HTTP: multipart, unifrom, attach, payload, filename, boundary,
>preamble, epilogue.
I don't really see an issue there; if need be we can list the "approved"
methods.
More information about the Web-SIG
mailing list