class documentation

class QueryParams(typing.Mapping[str, str]):

View In Hierarchy

URL query parameters, as a multi-dict.
Method __bool__ Undocumented
Method __contains__ Undocumented
Method __eq__ Undocumented
Method __getitem__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method __setitem__ Undocumented
Method __str__ Undocumented
Method add Return a new QueryParams instance, setting or appending the value of a key.
Method 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.
Method get​_list Get all values from the query param for a given key.
Method items Return all items in the query params. If a key occurs more than once only the first item for that key is returned.
Method keys Return all the keys in the query params.
Method merge Return a new QueryParams instance, updated with.
Method multi​_items Return all items in the query params. Allow duplicate keys to occur.
Method remove Return a new QueryParams instance, removing the value of a key.
Method set Return a new QueryParams instance, setting the value of a key.
Method update Undocumented
Method values Return all the values in the query params. If a key occurs more than once only the first item for that key is returned.
Instance Variable ​_dict Undocumented
def __bool__(self):

Undocumented

Returns
boolUndocumented
def __contains__(self, key):

Undocumented

Parameters
key:typing.AnyUndocumented
Returns
boolUndocumented
def __eq__(self, other):

Undocumented

Parameters
other:typing.AnyUndocumented
Returns
boolUndocumented
def __getitem__(self, key):

Undocumented

Parameters
key:typing.AnyUndocumented
Returns
strUndocumented
def __hash__(self):

Undocumented

Returns
intUndocumented
def __init__(self, *args, **kwargs):

Undocumented

Parameters
*args:QueryParamTypesUndocumented
**kwargs:typing.AnyUndocumented
def __iter__(self):

Undocumented

Returns
typing.Iterator[typing.Any]Undocumented
def __len__(self):

Undocumented

Returns
intUndocumented
def __repr__(self):

Undocumented

Returns
strUndocumented
def __setitem__(self, key, value):

Undocumented

Parameters
key:strUndocumented
value:strUndocumented
def __str__(self):

Undocumented

Returns
strUndocumented
def add(self, key, value=None):

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")

Parameters
key:strUndocumented
value:typing.AnyUndocumented
Returns
QueryParamsUndocumented
def get(self, key, default=None):

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"

Parameters
key:typing.AnyUndocumented
default:typing.AnyUndocumented
Returns
typing.AnyUndocumented
def get_list(self, key):

Get all values from the query param for a given key.

Usage:

q = httpx.QueryParams("a=123&a=456&b=789") assert q.get_list("a") == ["123", "456"]

Parameters
key:strUndocumented
Returns
typing.List[str]Undocumented
def items(self):

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")]

Returns
typing.ItemsViewUndocumented
def keys(self):

Return all the keys in the query params.

Usage:

q = httpx.QueryParams("a=123&a=456&b=789") assert list(q.keys()) == ["a", "b"]

Returns
typing.KeysViewUndocumented
def merge(self, params=None):

Return a new QueryParams instance, updated with.

Usage:

q = httpx.QueryParams("a=123") q = q.merge({"b": "456"}) assert q == httpx.QueryParams("a=123&b=456")

q = httpx.QueryParams("a=123") q = q.merge({"a": "456", "b": "789"}) assert q == httpx.QueryParams("a=456&b=789")

Parameters
params:QueryParamTypesUndocumented
Returns
QueryParamsUndocumented
def multi_items(self):

Return all items in the query params. Allow duplicate keys to occur.

Usage:

q = httpx.QueryParams("a=123&a=456&b=789") assert list(q.multi_items()) == [("a", "123"), ("a", "456"), ("b", "789")]

Returns
typing.List[typing.Tuple[str, str]]Undocumented
def remove(self, key):

Return a new QueryParams instance, removing the value of a key.

Usage:

q = httpx.QueryParams("a=123") q = q.remove("a") assert q == httpx.QueryParams("")

Parameters
key:strUndocumented
Returns
QueryParamsUndocumented
def set(self, key, value=None):

Return a new QueryParams instance, setting the value of a key.

Usage:

q = httpx.QueryParams("a=123") q = q.set("a", "456") assert q == httpx.QueryParams("a=456")

Parameters
key:strUndocumented
value:typing.AnyUndocumented
Returns
QueryParamsUndocumented
def update(self, params=None):

Undocumented

Parameters
params:QueryParamTypesUndocumented
def values(self):

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"]

Returns
typing.ValuesViewUndocumented
_dict =

Undocumented