body = environ['wsgi.input'].read(length)
environ['body_copy'] = body
environ['wsgi.input'] = StringIO(body)
app_iter = self.application(environ, self._sr_callback(start_response))
return app_iter

def _sr_callback(self, start_response):

    def callback(status, headers, exc_info=None):
        start_response(status, headers, exc_info)
return callback
app.wsgi_app = WSGICopyBody(app.wsgi_app)
request.environ['body_copy']
Get raw POST body in Python Flask regardless of Content-Type header