[Web-SIG] Request/Response features

Ian Bicking ianb at colorstudy.com
Thu Oct 23 00:03:40 EDT 2003


On Wednesday, October 22, 2003, at 10:12 PM, Ian Bicking wrote:
> I've very interested into getting some sort of sane request/response 
> object into the Python standard library, to form the basis of an 
> informal standard on how those objects should look (even if wrappers 
> or adaptation are required for most frameworks).  Technically I 
> suppose cgi.FieldStorage is a request object, but it's not a very good 
> one, and it's very incomplete outside of CGI (e.g., output goes to 
> sys.stdout, headers come from os.environ), and unusable in a threaded 
> environment.

I should actually append to this, on the pyweb list (archives at 
http://www.amk.ca/pipermail/pyweb/ ) I proposed a request/response 
interface, as a discussion starter if nothing else.  Well, constructive 
discussion didn't actually ensue, but the spec still exists.  In 
retrospect I shouldn't have tried to include anything outside of the 
request and response, as it's distracting and more controversial.  The 
interface I wrote is at:

   http://colorstudy.com/~ianb/IHTTP_01.py

If rewriting it, I'd probably just put the response in the request 
instead of having a transaction object -- the interface would consist 
purely of HTTPRequest and HTTPResponse.  I might remove some other 
methods as well, to make adapting/wrapping from other frameworks 
easier.  Anyway, it could serve as a starting point for other interface 
specifications.

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




More information about the Web-SIG mailing list