Encode values, not blindly the whole address
A complete URL contains structural characters such as : / ? & = and #. Encoding the whole string can turn those delimiters into data and make the address unusable. Encode user-provided parameter values or path segments with the function appropriate to that component.