title: json.Marshal how body of http.newRequest
body: <p>I'm working to create a little console for managing DigitalOcean Droplets, and I have this error:</p>
  <blockquote>
  <p>cannot use s (type []byte) as type io.Reader in argument to http.NewRequest:
  []byte does not implement io.Reader (missing Read method)</p>
  </blockquote>
  <p>How can I convert <code>s []bytes</code> in a good type of value for func <code>NewRequest</code>?! <code>NewRequest</code> expects <code>Body</code> of type <code>io.Reader</code>..</p>
  <pre><code>s, _ := json.Marshal(r);
  
  // convert type
  
  req, _ := http.NewRequest(&quot;GET&quot;, &quot;https://api.digitalocean.com/v2/droplets&quot;, s)                                          
  req.Header.Set(&quot;Authorization&quot;, fmt.Sprintf(&quot;Bearer %s&quot;, token))                                                          
  req.Header.Set(&quot;Content-Type&quot;, &quot;application/json&quot;)                            
  response, _ := client.Do(req)
  </code></pre>