def clear ( self ) -> None : self . _headers = httputil . HTTPHeaders ( { "Server" : "TornadoServer/%s" % tornado . version , "Content-Type" : "text/html; charset=UTF-8" , "Date" : httputil . format_timestamp ( time . time ( ) ) , } ) self . set_default_headers ( ) self . _write_buffer = [ ] # type: List[bytes] self . _status_code = 200 self . _reason = httputil . responses [ 200 ]
python tornado set default header
Resets all headers and content for this response .
def clear(self) -> None:
        """Resets all headers and content for this response."""
        self._headers = httputil.HTTPHeaders(
            {
                "Server": "TornadoServer/%s" % tornado.version,
                "Content-Type": "text/html; charset=UTF-8",
                "Date": httputil.format_timestamp(time.time()),
            }
        )
        self.set_default_headers()
        self._write_buffer = []  # type: List[bytes]
        self._status_code = 200
        self._reason = httputil.responses[200]