I'm trying to get access to the 'Referer' header value when
a page is
requested but I cannot !
I'm running CP 2.1.1 with Apache in front of it. Everything
works
normally apart from this. At first I thought the headers
structure was
dictionary (as per http:/
/docs.cherrypy.org/api-reference#request) but
I got error messages suggesting it was a generator (I don't
know much
about generators) so I tried doing this eventually to dump
them all out
and I get no output.
try:
print "About to iterate headers"
while 1:
print cherrypy.request.headers.next()
except StopIteration:
pass
print "About to iterate headers - again"
for k in cherrypy.request.headers():
print k
Could anyone tell me how they go about accessing something
out of this
structure (and bearing in mind I'm using an old version of
CP ?).
thanks
Richard.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|