[Twisted-Python] HTML shoudl not be baked into twisted.web HTTPimplementation

Jared Gisin jared.gisin at isilon.com
Wed Dec 9 20:10:56 EST 2009

It's unambiguously the correct default if you incorrectly assume that
you're always dealing with a web browser client, which is an invalid

The bottom line is that twisted.web contains the only implement of HTTP
in twisted which unfortunately is muddled in HTML. 

Get the HTML out of the HTTP protocol implementation. It flat out does
not belong there.

Twisted should provide a clean, clear interface for working with HTTP.
Call it twisted.protocols.http, then twisted.web with all of it's desire
to act like apache and serve up static content and run CGI's and speak
the default language of HTML can be built upon twisted.protocols.http
thus leaving me with a pure HTTP protocol implementation I can do other
this with as per RFC 2616 that have nothing to do with browsers or HTML.


-----Original Message-----
From: twisted-python-bounces at twistedmatrix.com
[mailto:twisted-python-bounces at twistedmatrix.com] On Behalf Of James Y
Sent: Wednesday, December 09, 2009 1:38 PM
To: Twisted general discussion
Subject: Re: [Twisted-Python] HTML shoudl not be baked into twisted.web

On Dec 9, 2009, at 4:18 PM, Valeriy Zamarayev wrote:

> I want to second Jared's point. In my case, the responses from web
servers, including the body, often end up in log files. HTML looks
pretty ugly there. Though this is a minor point for me in the otherwise
great Twisted software!

Essentially every web server on the internet responds with HTML to error
conditions, so you should probably modify your client.

As I said, I'm all for customizability, but returning HTML bodies for
error pages is unambiguously the correct default.

Twisted-Python mailing list
Twisted-Python at twistedmatrix.com

More information about the Twisted-Python mailing list