To fix TypeError: Request path contains unescaped characters error with Node, we call the encodeURI
function.
For instance, we write
const uri = "my test.asp?name=ståle&car=saab";
const res = encodeURI(uri);
to call encodeURI
to return an escaped version of the uri
string.