The result of trying this code:
Traceback (most recent call last):
File "/usr/lib64/python2.6/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/usr/lib64/python2.6/site-packages/mod_python/importer.py",
line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/usr/lib64/python2.6/site-packages/mod_python/importer.py",
line 1128, in _execute_target
result = object(arg)
File "/usr/lib64/python2.6/wsgiref/modpython_gateway.py", line 205,
in handler
module = __import__(modname, globals(), locals(), [''])
File "/www/path/service/serverw.py", line 10, in <module>
web.header('Content-Type', 'text/plain')
File "/usr/local/lib/python2.6/site-packages/web/webapi.py", line
222, in header
ctx.headers.append((hdr, value))
AttributeError: 'ThreadedDict' object has no attribute 'headers'
On 9 Feb., 04:19, Ben Corneau <
bencorn...@gmail.com> wrote:
> You can access the headers using web.ctx.envrion. Your headers will be
> an item in the envrion dict prepended with "HTTP_" and converted to
> upper case.
> I'm not familiar with modpython_gateway.py and don't know if it will
> change this behavior.
>
> example request (I've recently discovered requests,
http://docs.python-requests.org/en/latest/index.html. It's awesome!)