[Zope] setHeader, but no getHeader

Mark McEahern mark@mceahern.com
Fri, 31 Jan 2003 10:35:19 -0600


[Andreas Jung [mailto:lists@andreas-jung.com]]
> If you really need to look at the headers of the RESPONSE object then
> sniff into its header attribute. A get_header() method is IMO
> a clear case of YAGNI.

Yes, I'm not having a problem looking at the headers.  However, what I'm
saying is that the API of HTTPResponse is potentially confusing.  Why
convert some names to lowercase, only later to convert them to word
capitalization unless literal is specified?  If the HTTP RFC says header
names are case-insensitive, why not just use a case-insensitive dictionary
and be done with it?  If you want to talk YAGNI, then wouldn't that apply to
setHeader() as well?

My question is not about how to use HTTPResponse.  I've already gone through
the painful process of learning that (or so I think, anyway <wink>).  I'm
trying to have a conversation about why it is the way it is and whether
there's some way to reduce the learning curve for folks in the future.

Thanks,

// m

-