通过 Http 请求获取 GitHub 文件内容


 原始GitHub 文件地址:

  https://github.com/eric-projects/cv/blob/master/demo/example.json

 

可Http访问资源内容的地址:

  https://raw.githubusercontent.com/eric-projects/cv/master/demo/example.json

  •  raw.githubusercontent.com  资源服务器
  •  eric-projects 用户名
  •  cv 仓库名
  •  master/demo/example.json  文件地址

 请求结果:

 

 解决访问https://raw.githubusercontent.com 无法连接问题:

 通过 https://www.ipaddress.com/ 网站,找到 raw.githubusercontent.com 对应的IP 并加入本机Host 文件
 199.232.68.133 raw.githubusercontent.com


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM