nodejs使用axios进行http get请求时,报错TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters,其出现的原因是请求的url中携带中文参数。 如:https://www.zhihu.com/?city=北京 解决办法则是https://www.zhihu.com/?city=encodeURI(北京)
Node axios 中文处理
7 min read
nodejs使用axios进行http get请求时,报错TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters,其出现的原因是请求的url中携带中文参数。 如:https://www.zhihu.com/?city=北京 解决办法则是https://www.zhihu.com/?city=encodeURI(北京)