[mod_python] GET works, but POST doesn't in mod_python

Jon-Pierre Gentil jgentil at sebistar.net
Mon Aug 9 12:53:04 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ole Jacob Hagen wrote:
> Hi.
>
> I am experiencing the same problem as found in :
> http://mail.python.org/pipermail/python-list/2003-December/200961.html
> I have successfully accomplished how to send forms from a top frame to a
> bottom frame.
>
> So thanks for helping me out here.
>
> Remember that I am using psp, instead of the publisher.
>
> Output listings:
>
> I will give output from bot_frame.psp, using both POST and GET in
> top_frame.psp:
>
> user=mod_python
> database=psp
>
> When  method = \"GET\" in s
> bot_frame will produce following output:
>
> req.method is a GET[Field('user', 'mod_python'), Field('database', 'psp')]
> length of incoming message is: 0
>
> Which is correct, but when method=\"POST\" in s, bot_frame will produce
> following output:
> req.method is a POST[]
> length of incoming message is: 28
>
> Why doesn't POST works? It seems that the POST message is stored, since
> the length of string is 28....
> How can I retrieve it?

req.read will read POST variables, but not GET varibles.  to get GET
variables, you need to parse the original URL..

Its better just to use the FieldStorage class.  :D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iEYEARECAAYFAkEXq/AACgkQOrVFmaIbww4q7wCcCwByzQyI5bBgPYn1NX6/drS4
Fs4AoItP5sr8Q1DILHtg9yZr7a6+2sZx
=UC6z
-----END PGP SIGNATURE-----


More information about the Mod_python mailing list