[mod_python] FieldStorage and POST?

Graham Dumpleton grahamd at dscpl.com.au
Tue Jul 4 18:10:20 EDT 2006

smilelover at centrum.cz wrote ..
> Hi,
> I can't make FieldStorage instance give me my POST arguments.
> When I send my form data through GET, FieldStorage contains them. But when
> I use POST and then do:
> req.write(util.FieldStorage(req).list[0].value)
> Python tells me "list index out of range"
> I have googled quite a lot and found bits of information about problems
> with POST and FieldStorage, but nothing that could help me figure out 
> WHERE the POST data are.
> Thanks in advance for every hint.

Are you doing this from inside a function published using
mod_python.publisher, as opposed to a basic handler? If
you are doing this from inside a function published using
mod_python.publisher then it will already have consumed
the POST content of the request.

Thus, show more complete code for the function this is being
done in and show the Apache configuration you are using to
trigger that function. Also show what URL you are using and
how that relates to the names of your handler files or whether
the URL matches to the directory itself.

If you are using mod_python.publisher, the form parameters
are supplied to argument to function of same name. The raw
FieldStorage object can also be accessed as req.form, you do not
need to create it yourself.


More information about the Mod_python mailing list