title: Attach custom headers before every fetch request in react
body: <p>How can i add custom global header for all my fetch requests in react application. Is there any function to provide global header for all fetch request in react.</p>
  
  <pre><code>getFoo() {
          return fetch(apiUrl + "API/foo").then(
              function(response) {
                  return response.json();
              });
      }
  </code></pre>
  
  <p>Want to add global hear for my all fetch requests in react , i am stuck here please help me and  thanks in advance.</p>