[mod_python] Reading headers that were sent by the client

roy roy at 3mb.co.nz
Fri May 14 01:25:54 EDT 2004


Hello.
Your help is very appreciated.
* My goal is to get a request from client,
  rewrite the url and attach to it,  the headers that the client sent(browser info, etc..)

1.   How can I read headers that were sent by the client?
 I tried using req.headers_in() but I get error msg:
Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 193, in Dispatch
    result = object(req)

  File "/var/www/jazz/test/redPage.py", line 9, in handler
    req.write((str)(req.headers_in()))

TypeError: 'mp_table' object is not callable

2. Why  internal_redirect requests doesn't work?
   def handler(req):
       req.internal_redirect("www.google.com")

   generates error:
  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 85, in __getattr__
    raise AttributeError, attr

AttributeError: internal_redirect

Thank you very much
Roy
   



More information about the Mod_python mailing list