基于Golang的HTTP客户端,爬虫工具direwolf

wnanbei · · 1324 次点击
读数据报错 unexpected EOF 如果加> "Accept-Encoding": "gzip", 用resp.Content读出来的是字节,用string(resp.Content()) 是乱码 已提交github issue
#4
更多评论
如果客户端要维护长连接 该怎么写呢 https://wnanbei.github.io/direwolf/docs/tutorial#1-make-request 上没找到 另外如果发送 http头dw.NewHeaders( "Accept-Encoding", "gzip, deflate") 用 "compress/gzip" 的reader, err := gzip.NewReader(resp.Text()) 读取 ,提示 cannot use resp.Text() (type string) as type io.Reader in argument to gzip.NewReader: string does not implement io.Reader (missing Read method) 比如读这个页面 url="https://blog.csdn.net/yang731227/article/details/89338745" 读resp.Content() 提示 cannot use resp.Content() (type []byte) as type io.Reader in argument to gzip.NewReader: []byte does not implement io.Reader (missing Read method)
#2