[Web-SIG] Future of WSGI
mborch at gmail.com
Tue Nov 24 22:50:00 CET 2009
2009/11/24 Ian Bicking <ianb at colorstudy.com>:
> You mean specifically environ['wsgi.input'] ? While the file-like interface
> is difficult, other possible interfaces aren't so great either. As to
> putting the request body in the environment, I don't know what the problem
> is? Or are you just concerned that people put arbitrary things in the
> environ? There's far too many important use cases that are satisfied by the
> extensible nature of the environ to give it up just because some people
> believe it is overused.
How people use or abuse software is not our concern; but the standard
library should not itself abuse its own abstractions.
The file-like (stream) interface is fine, but it must not live in the
HTTP environment. I don't know of any other languages that mix the two
(Perl's CGI.pm does, but that's another matter).
Rather, what we need a request object. Don't think WebOb or
ZPublisher. This is just a decoder for the socket response.
It's quite symmetric:
Request = namedtuple("Request", "environ body")
Response = namedtuple("Response", "status headers iterable")
Iterable might be "body" or "chunks" or some other term.
More information about the Web-SIG