Node.js:请求模块是否支持无模式URI?

时间:2015-09-30 09:22:49

标签: node.js request

request模块是否支持某些无模式 URI?

我无法在文档中找到任何参考,也无法使用Google搜索。

尝试请求无模式URI(//www.example.com/),它抱怨"错误:无效的URI" ...

1 个答案:

答案 0 :(得分:1)

这些称为协议相对URL 。建议不要使用because SSL is encouraged everywhere

运行节点脚本时没有基本方案,而不是在浏览器中运行时。 request无法知道要使用哪种方案。

> url.parse("//www.example.com").protocol
null