MCPcopy Index your code
hub / github.com/python/cpython / send_header

Method send_header

Lib/http/server.py:552–564  ·  view source on GitHub ↗

Send a MIME header to the headers buffer.

(self, keyword, value)

Source from the content-addressed store, hash-verified

550 'latin-1', 'strict'))
551
552 def send_header(self, keyword, value):
553 """Send a MIME header to the headers buffer."""
554 if self.request_version != 'HTTP/0.9':
555 if not hasattr(self, '_headers_buffer'):
556 self._headers_buffer = []
557 self._headers_buffer.append(
558 ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))
559
560 if keyword.lower() == 'connection':
561 if value.lower() == 'close':
562 self.close_connection = True
563 elif value.lower() == 'keep-alive':
564 self.close_connection = False
565
566 def end_headers(self):
567 """Send the blank line ending the MIME headers."""

Callers 15

send_errorMethod · 0.95
send_responseMethod · 0.95
send_my_headersMethod · 0.80
do_GETMethod · 0.80
send_headMethod · 0.80
list_directoryMethod · 0.80
do_POSTMethod · 0.80
do_TESTMethod · 0.80
do_KEEPMethod · 0.80
do_CUSTOMMethod · 0.80
do_LATINONEHEADERMethod · 0.80
do_GETMethod · 0.80

Calls 3

appendMethod · 0.45
encodeMethod · 0.45
lowerMethod · 0.45

Tested by 12

do_POSTMethod · 0.64
do_TESTMethod · 0.64
do_KEEPMethod · 0.64
do_CUSTOMMethod · 0.64
do_LATINONEHEADERMethod · 0.64
do_GETMethod · 0.64
do_HEADMethod · 0.64
do_AUTHHEADMethod · 0.64
do_GETMethod · 0.64
send_headMethod · 0.64