Hi trying to know how get post data as Python3 documentation point to this repo and no one guide to get working :(
https://peps.python.org/pep-0594/#cgi
Finaly i found I need parse_form_data(environ)
But using it I get a endles loop in this line:
`data = stream.read(mem_limit).decode(charset)
this is a min of my code that freeze wiuth no putput on post:
import os, sys, multipart
def getData(environ):
try:
if environ.get("REQUEST_METHOD", "GET").upper() in ("POST", "PUT"):
return multipart.parse_form_data(environ)
return ""
except Exception as e:
print(str(e))
def application(environ, start_response):
try:
q = getData(environ)
print(q)
except Exception as e:
print(str(e))
from wsgiref.simple_server import make_server
httpd = make_server('', 8001, application)
print("Serving dynamic on port 8001...")
httpd.serve_forever()
Hi trying to know how get post data as Python3 documentation point to this repo and no one guide to get working :( https://peps.python.org/pep-0594/#cgi
Finaly i found I need
parse_form_data(environ)
But using it I get a endles loop in this line:
`data = stream.read(mem_limit).decode(charset)
this is a min of my code that freeze wiuth no putput on post:
Any help is welcome. Thanks in advance