URLSearchParams
Overview
URLSearchParams is a class in Aspose.Html FOSS for Python.
Ordered query-string pairs with duplicate-key support.
This class provides 12 methods for working with URLSearchParams objects in Python programs.
Available methods include: __init__, append, delete, entries, get, get_all, has, items, keys, set, sort, values.
All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package.
Properties: size.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
size | int | Read | Return the total number of name-value pairs, including duplicates. |
Methods
| Signature | Description |
|---|---|
__init__(init: str | dict[object, object] | list[tuple[object, object]] | None) | Calls init(init) on this URLSearchParams instance. |
append(name: str, value: str) | Append a name/value pair. |
delete(name: str, value: str | None) | Remove matching name-value pairs. |
get(name: str) → str | None | Return first value for name, else None. |
get_all(name: str) → list[str] | Return all values for name. |
has(name: str, value: str | None) → bool | Return True if a matching pair exists. |
set(name: str, value: str) | Replace all values for name with one value. |
sort() | Sort entries by name, stable for equal names. |
keys() → Iterator[str] | Calls keys on this URLSearchParams instance. |
values() → Iterator[str] | Calls values on this URLSearchParams instance. |
items() → Iterator[tuple[str, str]] | Calls items on this URLSearchParams instance. |
entries() → Iterator[tuple[str, str]] | Return an iterator of (name, value) pairs. |