Erik Johnson wrote:
> I am trying to work with a program that is trying make an HTTP POST
> of text data without any named form parameter. (I don't know - is
> that a normal thing to do?)

Often, people do require abnormal things.

> I need to write a CGI program that
> accepts and processes that data. I'm not seeing how to get at data
> that's not a named form parameter.

As far as CGI is concerned, the POST data resides in stdin. So accessing it
is as simple as reading sys.stdin within the CGI script. Of course, it is up
to you to interpret the data, though you can just read everything as a
string. The POST data could just as well be binary - such as a file upload.

To dump the strings to a file to your webserver, try the following script:

import sys

print 'Content-type: text/plain\r\n\r\n'

dumped = open('test.txt', 'wb')
for line in sys.stdin.readline():
    dumped.write(line)

HTH,
Sarat Venugopal
www.huelix.com






-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to