Categories
JavaScript Answers

How to fix TypeError: Request path contains unescaped characters error with Node?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.