title: How to add querystring to url via fetch (Web APIs)?
body: <p>This is my code using <a href="https://github.com/visionmedia/superagent" rel="nofollow">superagent</a> to call a server side endpoint</p>
  
  <pre><code>request     
    .get('/_api/get_data')    
    .query(`user_id=${userId}`)       
    .end((err, res) =&gt; {
  </code></pre>
  
  <p>This will issue a call to <code>http://server/_api/get_data?user_i=112223</code></p>
  
  <p>With <a href="https://developer.mozilla.org/en/docs/Web/API/Fetch_API" rel="nofollow">fetch</a>, the code has become:</p>
  
  <pre><code>let payload = {
    user_id: userId,
  }
  
  let data = new FormData(payload)
  
  let opts = {
    body: data,
    credentials: 'same-origin'
  }
  
  fetch('/_api/get_data', opts)
  .then((res) =&gt; {
  </code></pre>
  
  <p>With this new code, however, the querystring is not attached to the url.</p>
  
  <p>How can I accomplish this effect with <code>fetch</code>? </p>