def _writeResponse(self, response):
        """
        Serializes the response to JSON, and writes it to the transport.
        """
        encoded = dumps(response, default=_default)
        self.transport.write(encoded)
Serializes the response to JSON, and writes it to the transport.