def finish(self):
        """
        Override C{http.Request.finish} for possible encoding.
        """
        if self._encoder:
            data = self._encoder.finish()
            if data:
                http.Request.write(self, data)
        return http.Request.finish(self)

        Override C{http.Request.finish} for possible encoding.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/server.py