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

Method values

httpx/_urls.py:474–484  ·  view source on GitHub ↗

Return all the values 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.values()) == ["123", "789"]

(self)

Source from the content-addressed store, hash-verified

472 return self._dict.keys()
473
474 def values(self) -> typing.ValuesView[str]:
475 """
476 Return all the values in the query params. If a key occurs more than once
477 only the first item for that key is returned.
478
479 Usage:
480
481 q = httpx.QueryParams("a=123&a=456&b=789")
482 assert list(q.values()) == ["123", "789"]
483 """
484 return {k: v[0] for k, v in self._dict.items()}.values()
485
486 def items(self) -> typing.ItemsView[str, str]:
487 """

Callers 1

test_queryparamsFunction · 0.95

Calls 1

itemsMethod · 0.45

Tested by 1

test_queryparamsFunction · 0.76