I\'m writing a very simple web service, written in Python and run as CGI on an Apache server.
According to Python docs (somewhere... I forgot where), I can use sys.stdin
These are given to the CGI script through the environment:
import os user_agent = os.environ["HTTP_USER_AGENT"] ip = os.environ["REMOTE_ADDR"]