MCPcopy
hub / github.com/fluentpython/example-code-2e / add_header

Method add_header

21-async/mojifinder/bottle.py:1555–1557  ·  view source on GitHub ↗

Add an additional response header, not removing duplicates.

(self, name, value)

Source from the content-addressed store, hash-verified

1553 self._headers[_hkey(name)] = [_hval(value)]
1554
1555 def add_header(self, name, value):
1556 ''' Add an additional response header, not removing duplicates. '''
1557 self._headers.setdefault(_hkey(name), []).append(_hval(value))
1558
1559 def iter_headers(self):
1560 ''' Yield (header, value) tuples, skipping headers that are not

Callers 3

__init__Method · 0.95
start_responseMethod · 0.80
wrapperFunction · 0.80

Calls 4

_hkeyFunction · 0.85
_hvalFunction · 0.85
setdefaultMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected