MCPcopy
hub / github.com/tornadoweb/tornado / clear

Method clear

tornado/web.py:333–345  ·  view source on GitHub ↗

Resets all headers and content for this response.

(self)

Source from the content-addressed store, hash-verified

331 self.request._body_future.exception()
332
333 def clear(self) -> None:
334 """Resets all headers and content for this response."""
335 self._headers = httputil.HTTPHeaders(
336 {
337 "Server": "TornadoServer/%s" % tornado.version,
338 "Content-Type": "text/html; charset=UTF-8",
339 "Date": httputil.format_timestamp(time.time()),
340 }
341 )
342 self.set_default_headers()
343 self._write_buffer = [] # type: List[bytes]
344 self._status_code = 200
345 self._reason = httputil.responses[200]
346
347 def set_default_headers(self) -> None:
348 """Override this to set HTTP headers at the beginning of the request.

Callers 2

__init__Method · 0.95
send_errorMethod · 0.95

Calls 2

set_default_headersMethod · 0.95
timeMethod · 0.80

Tested by

no test coverage detected