title: Isomorphic fetch (REDUX / nodeJs) - POST request with username / password
body: <p>I am using the below code to get the data back from API and it works fine.  I have another API which is secured one and that requires a user name / password to access the content and I am not sure how to pass in the credentials when using isomorphic fetch module. Can someone help?</p>
  
  <p>I am using this module: <a href="https://www.npmjs.com/package/isomorphic-fetch" rel="nofollow noreferrer">https://www.npmjs.com/package/isomorphic-fetch</a></p>
  
  <p>I need to pass in username and password as below (Sample curl command)</p>
  
  <pre><code>curl -u admin:hello123 http://test:8765/select?q=*
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>fetch(
      url
  ).then(function (response) {
      if (response.status != 200) {
          dispatch(setError(response.status + '===&gt;' + response.statusText + '===&gt;' + response.url))
      }
      return response.json();
  }).then(function (json) {
      dispatch(setData(json, q))
  }).catch(function(err){
  });
  </code></pre>