code: func isTextResponse(resp *http.Response) bool {
  	contentType := resp.Header.Get("Content-Type")
  	if len(contentType) == 0 {
  		return true
  	}
  	media, _, err := mime.ParseMediaType(contentType)
  	if err != nil {
  		return false
  	}
  	return strings.HasPrefix(media, "text/")
  }
docs: // isTextResponse returns true if the response appears to be a textual media type.