Jesus Loves GRASS

Technical blog about GRASS/GIS,open source geoinformatics and MAPSERVER.

Friday, October 05, 2007

By the Love of G-d where are my POST variables !!!!

I am working in a WPS web service, using mod_python and PyWPS, and all the time I was using GET as HTTP request.

The WPS needs for some requests to be in the form of XML file so there is a need to implement POST to send such requests, for start I decided to try using POST to fetch some Key-Value-Pair.

I used the util class of mod_python as usual to deal with the request (as indicated on the mod_python tutorial:

form=util.FieldStorage(req)

But the form list was empty, tried so many things and so many possibilities like

request_made=req.read()

The only thing I was getting was a null reply, everything empty !!!

I found a post in the mod_python mailing-list with the same problem but no answer....and nothing on the specifications of mod_python.

Finally I discovered the problem !!!! POST was always empty because of PythonHandler mod_python.publisher and by dropping it and using my script file (wps2.py) as handler (PythonHandler wps2)the problem got solved. So the conclusion is: DON'T USE Publisher handler + POST together.

Also there is a huge lack of info on this POST "problem"!!!! This should be referred in the documentation !!!!

Labels: , , , ,