Getting all client http headers

Bengt Richter bokr at accessone.com
Sat Jun 23 14:37:38 EDT 2001


On Tue, 19 Jun 2001 08:22:51 GMT, Joonas Paalasmaa
<joonas.paalasmaa at nokia.com> wrote:

>How can I get all client http headers in python.
>Can I use cgi-module?
>
>-Joonas

For a quick and dirty look at what your browser
is sending the server (though this won't show
post method content), try putting this in the
cgi-bin directory of your server site,
and look at it via browser at

http://--your-site-goes-here--/cgi-bin/test.py

#!/usr/bin/python
print 'Content-type: text/plain\n'

import sys
for i in xrange(len(sys.argv)):
	print "arg[%d]=%s" %(i,sys.argv[i])

import os
for k in os.environ.keys():
	print k,'=',os.environ[k]




More information about the Python-list mailing list