How to get the contact with multipart experts?

I can still create my own web system directly from the Apache server (from XAMPP) without using cumbersome interface like WSIG, FLAGS. This way, most of the data can be easily extracted from os.environ. However, I have only one problem.

Currently I have been using cgi.FieldStorage to get the HTTP POST query. However, I have been advised to start using multipart from now on because cgi.FieldStorage is deprecated and slated for removal in Python 3.13! However, I still do not see an example of how to get the HTTP POST query with the function multipart!? I am mainly wondering where the HTTP POST query is stored by Apache or os.environ.

Help, I really need any help for this problem!

Would you consider looking into a web framework like Flask rather than trying to do everything by hand?

httpd CGI interface is:

  • stdin - read this to get the body of a request (not limited to POST)
  • stdout -write your HTTP headers and content here
  • os.enviroment. Look in here for all the details of the request.

The env vars are documented, buts I tend to write a cgi script like this to check what is set.
Put it in /var/www/html/cgi-bin/env.sh.
And browser to it as http://localhost/cgi-bin/env.sh

#!/bin/bash
echo Content-type: text/plain
echo
id
env

Thank you very for the SIMPLE solution. Now I’m able to use stdin in order to get the HTTP POST request string!