MCPcopy
hub / github.com/encode/httpx / items

Method items

httpx/_models.py:216–229  ·  httpx/_models.py::Headers.items

Return `(key, value)` items of headers. Concatenate headers into a single comma separated value when a key occurs multiple times.

(self)

Source from the content-addressed store, hash-verified

214 return values_dict.values()
215
216 def items(self) -> typing.ItemsView[str, str]:
217 class="st">"""
218 Return `(key, value)` items of headers. Concatenate headers
219 into a single comma separated value when a key occurs multiple times.
220 class="st">"""
221 values_dict: dict[str, str] = {}
222 for _, key, value in self._list:
223 str_key = key.decode(self.encoding)
224 str_value = value.decode(self.encoding)
225 if str_key in values_dict:
226 values_dict[str_key] += fclass="st">", {str_value}"
227 else:
228 values_dict[str_key] = str_value
229 return values_dict.items()
230
231 def multi_items(self) -> list[tuple[str, str]]:
232 class="st">"""

Callers 15

test_headersFunction · 0.95
_get_header_valueMethod · 0.45
encode_urlencoded_dataFunction · 0.45
__init__Method · 0.45
_prepareMethod · 0.45
__getstate__Method · 0.45
__setstate__Method · 0.45
_prepareMethod · 0.45
__getstate__Method · 0.45
__setstate__Method · 0.45
__init__Method · 0.45
render_headersMethod · 0.45

Calls 1

decodeMethod · 0.45

Tested by 9

test_headersFunction · 0.76
clean_environFunction · 0.36
test_proxies_environFunction · 0.36
challenge_sendMethod · 0.36