英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论