Path segments, query values, fragments, and complete URLs do not share one safe character set
Encoding an entire URL can hide structural delimiters such as colon, slash, question mark, ampersand, and equals. Encode dynamic values before assembling them into the URL with a URL API. A query parameter value and a path segment may require different treatment, especially for slash and plus.