urlencode
Escape a value for use in a URL.
The safe parameter determines the characters which should not be
escaped by Python's quote() function. If not provided, use the default safe
characters (but an empty string can be provided when all characters
should be escaped).
def urlencode(
value: string,
safe: string = None
) - > string
Escape a value for use in a URL. The safe parameter determines the characters which should not be escaped by Python's quote() function. If not provided, use the default safe characters (but an empty string can be provided when all characters should be escaped).
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | The input string to be escaped for use in a URL. |
| safe | string = None | A string containing characters that should not be escaped; if an empty string is provided, all characters will be escaped. |
Returns
| Type | Description |
|---|---|
string | The URL-encoded version of the input string, with special characters replaced by their percent-encoded equivalents. |