为了账号安全,请及时绑定邮箱和手机立即绑定

无法访问 raw.githubusercontent.com

无法访问 raw.githubusercontent.com

Go
米琪卡哇伊 2022-10-24 15:16:03
我想通过 raw.githubusercontent.com 在 github 中下载一些文件。在使用golang实现这个功能的时候,遇到如下错误:dial tcp: lookup raw.githubusercontent.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.我的代码:url1 := "https://raw.githubusercontent.com/pupillord/tiny-cs/main/README.md"// the error mentioned above will appear hereresp, err := http.Get(url1)注意:如果我直接在网站上打开,我可以正常访问该文件。
查看完整描述

1 回答

?
慕码人8056858

TA贡献1803条经验 获得超6个赞

此错误消息与 WinsockWSANO_DATA错误代码相关联。这意味着,您尝试连接的域名的 DNS 记录存在问题。

见这里: https ://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2#WSANO_DATA

  1. 我认为重新启动服务器可能会解决它。

  2. 您应该调查环境的 DNS 设置

  3. 如果您手动输入地址,请确保拼写正确

  4. 尝试手动输入 URL


查看完整回答
反对 回复 2022-10-24
  • 1 回答
  • 0 关注
  • 395 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号