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

Method write_headers

tornado/httputil.py:741–763  ·  view source on GitHub ↗

Write an HTTP header block. :arg start_line: a `.RequestStartLine` or `.ResponseStartLine`. :arg headers: a `.HTTPHeaders` instance. :arg chunk: the first (optional) chunk of data. This is an optimization so that small responses can be written in the same call a

(
        self,
        start_line: Union["RequestStartLine", "ResponseStartLine"],
        headers: HTTPHeaders,
        chunk: Optional[bytes] = None,
    )

Source from the content-addressed store, hash-verified

739 """
740
741 def write_headers(
742 self,
743 start_line: Union["RequestStartLine", "ResponseStartLine"],
744 headers: HTTPHeaders,
745 chunk: Optional[bytes] = None,
746 ) -> "Future[None]":
747 """Write an HTTP header block.
748
749 :arg start_line: a `.RequestStartLine` or `.ResponseStartLine`.
750 :arg headers: a `.HTTPHeaders` instance.
751 :arg chunk: the first (optional) chunk of data. This is an optimization
752 so that small responses can be written in the same call as their
753 headers.
754
755 The ``version`` field of ``start_line`` is ignored.
756
757 Returns a future for flow control.
758
759 .. versionchanged:: 6.0
760
761 The ``callback`` argument was removed.
762 """
763 raise NotImplementedError()
764
765 def write(self, chunk: bytes) -> "Future[None]":
766 """Writes a chunk of body data.

Callers 12

handle_requestMethod · 0.45
flushMethod · 0.45
finishMethod · 0.45
runMethod · 0.45
finishMethod · 0.45
headers_receivedMethod · 0.45
handle_requestMethod · 0.45
respond_100Method · 0.45
respond_204Method · 0.45
finishMethod · 0.45
finishMethod · 0.45
request_callableMethod · 0.45

Calls

no outgoing calls

Tested by 8

finishMethod · 0.36
headers_receivedMethod · 0.36
handle_requestMethod · 0.36
respond_100Method · 0.36
respond_204Method · 0.36
finishMethod · 0.36
finishMethod · 0.36
request_callableMethod · 0.36