【发布时间】:2022-12-27 16:44:12
【问题描述】:
I want to download some files in github by raw.githubusercontent.com.
When using golang to implement this function, I encountered the following error:
dial tcp: lookup raw.githubusercontent.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.
My code:
url1 := "https://raw.githubusercontent.com/pupillord/tiny-cs/main/README.md"
// the error mentioned above will appear here
resp, err := http.Get(url1)
Note: If I open it directly on the website, I can access the file normally.
【问题讨论】:
-
http.Getworks for me: imgur.com/XWFAJaM
标签: go