http客户端请求的时候打印日志 protocol error: received DATA before a HEADERS frame
链接有时候会有301:
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
response, err := client.Do(request)
if err != nil {
return
}
defer func() {
_ = response.Body.Close()
}()
location := response.Header.Get("Location")
就是想取个301地址、有时候链接也会200、想不明白为啥会打印错误日志、查了好久也没查到解决方案、有没有大哥帮忙解惑
有疑问加站长微信联系(非本文作者)