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)
| 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">""" |
no outgoing calls