In my project, I have an array of bytes from the response to the request.
defer resp.Body.Close() if resp.StatusCode != http.StatusOK { log.Println("StatusCode为" + strconv.Itoa(resp.StatusCode)) return } respByte, err := ioutil.ReadAll(resp.Body) if err != nil { log.Println("fail to read response data") return }
This works, but if I want to get the response body for io.read , how do I convert? I tried newreader / writer but was not successful.
go
Chan Willson Apr 20 '15 at 11:05 2015-04-20 11:05
source share