Open bincooo opened 5 months ago
你好,可否在遇到stream响应头时不要读取body?
https://github.com/wangluozhe/requests/blob/ac53c643373710472bab5eb5f69474248a834175/sessions.go#L465
stream := strings.Contains(resp.Header.Get("Content-Type"), "application/stream") || strings.Contains(resp.Header.Get("Content-Type"), "text/event-stream") if stream { response := &models.Response{ Url: preq.Url, Headers: resp.Header, Cookies: resp.Cookies(), Text: "", Content: nil, Body: resp.Body, StatusCode: resp.StatusCode, History: []*models.Response{}, Request: req, } if resp.Cookies() != nil { u, _ := url2.Parse(preq.Url) s.Cookies.SetCookies(u, resp.Cookies()) } return response, nil }
这应该还缺了编码处理,可添加这部分处理进项目嘛 ?
你好,可否在遇到stream响应头时不要读取body?
https://github.com/wangluozhe/requests/blob/ac53c643373710472bab5eb5f69474248a834175/sessions.go#L465
这应该还缺了编码处理,可添加这部分处理进项目嘛 ?