http.Get 返回“协议不可用”错误。

huangapple go评论92阅读模式
英文:

http.Get returns Protocol not available error

问题

当我尝试运行这个例子时,http://golang.org/pkg/net/http/#example_Get,它返回以下错误:

>2009/11/10 23:00:00 Get http://www.google.com/robots.txt: dial tcp: Protocol not available

有任何想法为什么会这样?

英文:

When I try to run this example at http://golang.org/pkg/net/http/#example_Get, it returns the following error

>2009/11/10 23:00:00 Get http://www.google.com/robots.txt: dial tcp: Protocol not available

Any idea why?

答案1

得分: 44

Go Playground不允许进行HTTP请求。这与代码无关,而是Playground强制执行的安全预防措施。

英文:

The Go Playground does not allow HTTP requests. This has nothing to do with code. It is a security precaution enforced by the playground.

huangapple
  • 本文由 发表于 2015年6月5日 18:44:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/30664557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定