[Web-SIG] Move to bless Graham's WSGI 1.1 as official spec

Malthe Borch mborch at gmail.com
Mon Dec 7 12:19:36 CET 2009



On 12/4/09 12:50 AM, And Clover wrote:
> So for now there is basically nothing useful WSGI can do other than
> provide direct, byte-oriented (even if wrapped in 8859-1 unicode
> strings) access to headers.

You could argue that this is perhaps a good reason to replace 
``environ`` with something that interprets the headers according to how 
HTTP is actually used in the real world.

It may be that WSGI should use bytes everywhere and the recommended 
usage would be via a decorator (which could cache computations on the 
environ dictionary):

e.g. the raw application handler versus one decorated with an imaginary 
``webob`` function.

   def app(environ, start_response):
       ...

   @webob
   def app(request):
       ...

It is often said that WSGI should be practical, but in actual usage, I 
think most developers use a request/response abstraction layer.

Middlewares are usually shrink-wrapped library code that could handle a 
bytes-based environ dict (they'd have to explicitly decode the headers 
of interest).

\malthe



More information about the Web-SIG mailing list