擅长:python、mysql、java
<p>关于(1),只要请求的头可用,Apache就将控制权传递给mod_wsgi处理程序,然后mod_wsgi将控制权传递给Python。然后,<code>request.body</code>的内部实现调用<code>read()</code>方法,该方法最终调用mod uwsgi中的实现,<a href="https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/src/server/mod_wsgi.c#L832" rel="nofollow noreferrer">requests the request's body from Apache</a>如果Apache还没有完全接收到它,则会阻塞直到它可用为止。在</p>
<p>关于(2),这是不可能单独使用mod\wsgi。至少,<a href="https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/src/server/mod_wsgi.c#L6025" rel="nofollow noreferrer">the hook processing incoming requests</a>在完整请求可用之前不提供阻止机制。另一张海报建议在<a href="https://stackoverflow.com/questions/18173201/make-apache-read-all-posted-data-before-passing-it-on-to-django">a response to this duplicate question</a>中使用nginx作为代理。在</p>