I have a very simple CGI webserver running using python CGIHTTPServer class. This class spawns and executes a cgi-php script. If the webpage sends POST request, how can I access the POST request data in the php script?
Accessing POST request data from CGIHTTPServer (python)
1.3k Views Asked by Methos At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in CGI
- Disconnect Client connected to cgi application
- Python CGI script won't execute if I 'import cgi'
- .jpg out of .cgi with java (IP Webcam)
- Input parameter for perl CGI script
- A C cgi script to serve binary file from sqlite3_column_blob pointer
- How to run CGI script in web browser?
- Can parse GET params from URL
- How to get POST parameters from CGI scripts written in bash?
- Can not get params from URL - why is my cgi.FieldStorage() empty?
- File not found error, but file exists
- QUERY_STRING is not obtained in CGI (C code)
- Get username on Server that uses digest authentication (Perl)
- calling cgi script from other cgi script
- Attaching CGI python script to PyCharm debugger?
- Having trouble executing a python script from the web browser
Related Questions in WEBSERVER
- How to prevent timeout when running a time consuming PHP
- How to get response from server every second in JSON?
- Apache Server (xampp) doesn't run on Windows 10 (Port 80)
- Upgrade SonarQube issues
- How to test java server without deployment?
- Deploy Jekyll project without a webserver
- TCP Window Update Scenarios
- Cors doesnt solve cross origin requests
- How do I configure my Android emulator to access my localhost?
- Do i need to install some packages to run javascript on debian
- Best practice for docker webserver, muliple layers or single layer?
- What is meant by the term "web root"?
- Connect IOT module to the internet server
- Raspberry pi Webserver handling Get Requests
- why db execution doesn't stops even if I stops the web browser?
Related Questions in CGIHTTPREQUESTHANDLER
- How to make CGIHTTPRequestHandler execute my PHP scripts with POST data
- python basehttpserver and cgihttpserver do_GET(self), use cgi requesthandler and base requesthandler
- How to pre-process requests before handling them using BaseHTTPServer?
- How can i find out names of uploaded files using 'CGIHTTPServer.CGIHTTPRequestHandler' do_POST?
- CGIHTTPRequestHandler run php or python script in python
- Unable to run python cgi scripts using CGIHTTPRequestHandler in Python 3.3
- Accessing POST request data from CGIHTTPServer (python)
- Python CGIHTTPServer Default Directories
- CGI not working with built-in Python 3.1 http.server
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
When you say your Python process "spawns and executes" a cgi-php script, I believe what you mean is "it calls my PHP script by executing the PHP CLI executable, passing it the name of my script."
Using the PHP CLI executable, HTTP-specific superglobals and environment values will not be set automatically. You would have to read in all HTTP request headers and GET/POST data in your Python server process, and then set them in the environment used by your PHP script.
The whole experiment sounds interesting, but this is what mod_php does already.