Unfortunately, due to the complexity of URL escaping, the real answer is "it depends." There are slightly different rules for percent coding path segments and query strings, for example.
I do not know exactly what you are trying to code, but I recommend sticking with the http-types package. One place to start would be urlEncode , although there are many other features in this package (such as encodePathSegments mentioned by @jamshidh) that are worth a look.
source share