Re: [Zope] Accessing HTTP request headers
No, I actually need access to the headers the client sent. I've looked through parts of the Zope source and can't find a method that will do what I want. Is there an existing method to access the client's headers? If not, how would I write my own code to parse them? How can I get access to the header text from the client so that I can parse it? ----- Original Message ----- From: Thomas Guettler <guettli@thomas-guettler.de> Date: Mon, 7 Apr 2003 15:41:33 +0200 To: zope@zope.org Subject: Re: [Zope] Accessing HTTP request headers
On Sun, Apr 06, 2003 at 03:06:52PM -0500, Matt Ficken wrote:
How can I access the headers an HTTP client sent in their request from within a Folder class. I can access the response headers in self.REQUEST.RESPONSE.headers. How do I access the request headers?
Hi,
is REQUEST['HTTP_REFERER'] what you were looking for?
thomas
-- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup
On Tuesday, April 8, 2003, at 12:07 AM, Matt Ficken wrote:
No, I actually need access to the headers the client sent. I've looked through parts of the Zope source and can't find a method that will do what I want. Is there an existing method to access the client's headers?
Dunno if this helps, but here's how you can list all the headers in ZPT: <table border="1" tal:define="hdrkeys python:request.keys()"> <tr tal:repeat="kk hdrkeys"> <td tal:content="kk">key</td> <td tal:content="python:request.values()[repeat['kk'].index]">val</td> </tr> </table> ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
Matt Ficken wrote at 2003-4-7 23:07 -0500:
No, I actually need access to the headers the client sent.
The content of "REQUEST.environ" contains the headers the client has sent. The differences: Headers may have gotten an "HTTP_" prefix "-" has been translated into "_". Case may be normalized. Dieter
participants (3)
-
Dieter Maurer -
Ed Leafe -
Matt Ficken