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

Method get

httpx/_urls.py:512–524  ·  httpx/_urls.py::QueryParams.get

Get a value from the query param for a given key. If the key occurs more than once, then only the first value is returned. Usage: q = httpx.QueryParams("a=123&a=456&b=789") assert q.get("a") == "123"

(self, key: typing.Any, default: typing.Any = None)

Source from the content-addressed store, hash-verified

510 return multi_items
511
512 def get(self, key: typing.Any, default: typing.Any = None) -> typing.Any:
513 class="st">"""
514 Get a value from the query param for a given key. If the key occurs
515 more than once, then only the first value is returned.
516
517 Usage:
518
519 q = httpx.QueryParams(class="st">"a=123&a=456&b=789")
520 assert q.get(class="st">"a") == class="st">"123"
521 class="st">"""
522 if key in self._dict:
523 return self._dict[str(key)][0]
524 return default
525
526 def get_list(self, key: str) -> list[str]:
527 class="st">"""

Callers 3

redirectsFunction · 0.95
test_queryparamsFunction · 0.95
get_listMethod · 0.45

Calls

no outgoing calls

Tested by 2

redirectsFunction · 0.76
test_queryparamsFunction · 0.76