title: Access HTTP response as string in Go
body: <p>I'd like to parse the response of a web request, but I'm getting trouble accessing it as string. </p>
  
  <pre><code>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 &lt; len(body); i++ {
          fmt.Println( body[i] ) // This logs uint8 and prints numbers
      }
  
      fmt.Println( reflect.TypeOf(body) )
      fmt.Println("done")
  }
  </code></pre>
  
  <p>How can I access the response as string? <code>ioutil.WriteFile</code> writes correctly the response to a file. </p>
  
  <p>I've already checked the package reference but it's not really helpful.</p>