How to parse the “request body” using python CGI?

前端 未结 2 930
醉梦人生
醉梦人生 2021-02-08 06:11

I just need to write a simple python CGI script to parse the contents of a POST request containing JSON. This is only test code so that I can test a client application until th

2条回答
  •  时光说笑
    2021-02-08 07:08

    If you're using CGI, just read data from stdin:

    import sys
    data = sys.stdin.read()
    

提交回复
热议问题