Return a new QueryParams instance, setting or appending the value of a key. Usage: q = httpx.QueryParams("a=123") q = q.add("a", "456") assert q == httpx.QueryParams("a=123&a=456")
(self, key: str, value: typing.Any = None)
| 550 | return q |
| 551 | |
| 552 | def add(self, key: str, value: typing.Any = None) -> QueryParams: |
| 553 | class="st">""" |
| 554 | Return a new QueryParams instance, setting or appending the value of a key. |
| 555 | |
| 556 | Usage: |
| 557 | |
| 558 | q = httpx.QueryParams(class="st">"a=123") |
| 559 | q = q.add(class="st">"a", class="st">"456") |
| 560 | assert q == httpx.QueryParams(class="st">"a=123&a=456") |
| 561 | class="st">""" |
| 562 | q = QueryParams() |
| 563 | q._dict = dict(self._dict) |
| 564 | q._dict[str(key)] = q.get_list(key) + [primitive_value_to_str(value)] |
| 565 | return q |
| 566 | |
| 567 | def remove(self, key: str) -> QueryParams: |
| 568 | class="st">""" |