Python POST data using mod_wsgi

前端 未结 2 1925
灰色年华
灰色年华 2020-12-15 07:40

This must be a very simple question, but I don\'t seem to be able to figure out.

I\'m using apache + mod_wsgi to host my python application, and I\'d like to get the

2条回答
  •  借酒劲吻你
    2020-12-15 07:41

    Be aware that technically speaking calling read() or read(-1) on wsgi.input is a violation of the WSGI specification even though Apache/mod_wsgi allows it. This is because the WSGI specification requires that a valid length argument be supplied. The WSGI specification also says you shouldn't read more data than is specified by the CONTENT_LENGTH.

    So, the code above may work in Apache/mod_wsgi but it isn't portable WSGI code and will fail on some other WSGI implementations. To be correct, determine request content length and supply that value to read().

提交回复
热议问题