code: async def wait_for_body_middleware(environ, start_response=None):
      '''Use this middleware to wait for the full body.
  
      This middleware wait for the full body to be received before letting
      other middleware to be processed.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.
      '''
      if environ.get('wsgi.async'):
          try:
              chunk = await environ['wsgi.input'].read()
          except TypeError:
              chunk = b''
          environ['wsgi.input'] = BytesIO(chunk)
          environ.pop('wsgi.async'ync def wait_for_body_middleware(environ, start_response=None):
      '''Use this middleware to wait for the full body.
  
      This middleware wait for the full body to be received before letting
      other middleware to be processed.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.
      '''
      if environ.get('wsgi.async'):
          try:
              chunk = await environ['wsgi.input'].read()
          except TypeError:
              chunk = b''
          environ['wsgi.input'] = BytesIO(chunk)
          environ.pop('wsgi.async')
docs: Use this middleware to wait for the full body.
  
      This middleware wait for the full body to be received before letting
      other middleware to be processed.
  
      Useful when using synchronous web-frameworks such as :django:`django <>`.