I am very new to python and having to get into this stuff for a simple program to integrate with an ASP.NET application that I am building. The pseudo code is as follows.
- Get two parameters from request. (A ASP.NET will be calling this url by POST and sending two parameters)
- Internally execute some business logic and build some response.
- Write the response back so that the ASP.NET app can proceed.
Step 2 and 3 are already in place and working too but not able to find a solution for Step 1 (I know it should be very simple and know how to do it in Java/.NET/PHP and RoR but not in Python and the online docs/tutorials are not helping my cause). I am running python on apache using mod_python.
Any help here is greatly appreciated. Thanks in advance
Vijay
Here is a good beginner’s tutorial for mod_python.
As far as I understand your question you have a mod_python-based script and you want to read a POST parameter. Therefore you only have to use the
formobject which is automatically provided by mod_python:You can find the documentation over here.
Note that this solution is when your server is configured with
PythonHandler mod_python.pspwhich will allow you to use “Python Server Pages” (special <% %> tags, automatically created variables likeform, …). If you’re writing a normal mod_python handler, then it would look something like that: