[Web-SIG] Request and Response objects

Casey Duncan casey at zope.com
Wed Nov 5 13:15:17 EST 2003


On Wed, 5 Nov 2003 12:59:06 -0500 (EST)
"Gregory (Grisha) Trubetskoy" <grisha at modpython.org> wrote:

> 
> 
> On Wed, 5 Nov 2003, Ian Bicking wrote:
> 
> > > (BTW, HTTP errors shouldn't happen if your application is written
> > > well.)
> >
> > Of course applications should return errors.  404 is common, 401 and
> > 403 are entirely reasonable, and 400 is a reasonable way to respond to
> > unexpected input; 30x errors are obviously okay, and fit into an
> > overall framework of exceptions.  And WebDAV servers have to set the
> > error response very specifically, including the body of the response.
> 
> I guess this depends on what we mean by "application".
> 
> If I log in to my online banking, click on "confirm payment" and get 404
> HTTP_NOT_FOUND, I will probably get on the phone with their customer
> service right away.

Setting status 4xx/5xx does not preclude the server from returning a human-readable response entity body. In fact the HTTP spec says that servers should return one and that user-agents should display it.

Of course, in some cases (like 401 unauthorized) a user-agent will choose to do something other than display the response body to the user. 

-Casey



More information about the Web-SIG mailing list