MCPcopy Create free account
hub / github.com/EasyIME/PIME / url_escape

Function url_escape

python/python3/tornado/escape.py:91–103  ·  view source on GitHub ↗

Returns a URL-encoded version of the given value. If ``plus`` is true (the default), spaces will be represented as "+" instead of "%20". This is appropriate for query strings but not for the path component of a URL. Note that this default is the reverse of Python's urllib module.

(value: Union[str, bytes], plus: bool = True)

Source from the content-addressed store, hash-verified

89
90
91def url_escape(value: Union[str, bytes], plus: bool = True) -> str:
92 """Returns a URL-encoded version of the given value.
93
94 If ``plus`` is true (the default), spaces will be represented
95 as "+" instead of "%20". This is appropriate for query strings
96 but not for the path component of a URL. Note that this default
97 is the reverse of Python's urllib module.
98
99 .. versionadded:: 3.1
100 The ``plus`` argument
101 """
102 quote = urllib.parse.quote_plus if plus else urllib.parse.quote
103 return quote(utf8(value))
104
105
106@typing.overload

Callers 3

reverseMethod · 0.90

Calls 1

utf8Function · 0.85

Tested by 2