title: ioutil.ReadAll(response.Body) blocks forever - Golang
body: <pre><code>tr := &amp;http.Transport{
      TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
  }
  client := &amp;http.Client{Transport: tr}
  response, err := client.Get(link)
  if err != nil {
      fmt.Println(err)
  }
  defer response.Body.Close()
  
  //block forever at the next line
  content, _ = ioutil.ReadAll(response.Body)
  </code></pre>
  
  <p>The above is my code to read content from a webpage which resides in a loop. I found sometimes the line <code>ioutil.ReadAll(response.Body)</code> will block forever. This happens randomly, however, it almost always happens on this webpage: <code>http://xkcd.com/55</code> . It's very interesting that when I do <code>curl http://xkcd.com/55</code>, it returns nothing, however, <code>wget http://xkcd.com/55</code> returns the whole webpage.</p>