MCPcopy
hub / github.com/scrapy/scrapy / get

Method get

scrapy/http/headers.py:76–80  ·  scrapy/http/headers.py::Headers.get
(self, key: AnyStr, def_val: Any = None)

Source from the content-addressed store, hash-verified

74 return None
75
76 def get(self, key: AnyStr, def_val: Any = None) -> bytes | None:
77 try:
78 return cast(class="st">"list[bytes]", super().get(key, def_val))[-1]
79 except IndexError:
80 return None
81
82 def getlist(self, key: AnyStr, def_val: Any = None) -> list[bytes]:
83 try:

Callers 15

test_basicsMethod · 0.95
test_single_valueMethod · 0.95
test_multivalueMethod · 0.95
test_none_valueMethod · 0.95
serialize_fieldMethod · 0.45
serialize_fieldMethod · 0.45
serialize_fieldMethod · 0.45
pushMethod · 0.45
get_spider_loaderFunction · 0.45
startMethod · 0.45
from_mimetypeMethod · 0.45

Calls

no outgoing calls

Tested by 15

test_basicsMethod · 0.76
test_single_valueMethod · 0.76
test_multivalueMethod · 0.76
test_none_valueMethod · 0.76
_mocked_download_funcFunction · 0.36
media_to_downloadMethod · 0.36
get_media_requestsMethod · 0.36
thumb_pathMethod · 0.36