Access HTTP response as string in Go
I’d like to parse the response of a web request, but I’m getting trouble accessing it as string. func main() { resp, err := http.Get(“http://google.hu/”) if err != nil { // handle error } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) ioutil.WriteFile(“dump”, body, 0600) for i:= 0; i < len(body); i++ { fmt.Println( body[i] ) // … Read more