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

Method items

httpx/_urls.py:486–496  ·  view source on GitHub ↗

Return all items in the query params. If a key occurs more than once only the first item for that key is returned. Usage: q = httpx.QueryParams("a=123&a=456&b=789") assert list(q.items()) == [("a", "123"), ("b", "789")]

(self)

Source from the content-addressed store, hash-verified

484 return {k: v[0] for k, v in self._dict.items()}.values()
485
486 def items(self) -> typing.ItemsView[str, str]:
487 """
488 Return all items in the query params. If a key occurs more than once
489 only the first item for that key is returned.
490
491 Usage:
492
493 q = httpx.QueryParams("a=123&a=456&b=789")
494 assert list(q.items()) == [("a", "123"), ("b", "789")]
495 """
496 return {k: v[0] for k, v in self._dict.items()}.items()
497
498 def multi_items(self) -> list[tuple[str, str]]:
499 """

Callers 5

test_queryparamsFunction · 0.95
__init__Method · 0.45
__init__Method · 0.45
valuesMethod · 0.45
multi_itemsMethod · 0.45

Calls

no outgoing calls

Tested by 1

test_queryparamsFunction · 0.76