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.
getFoo() {
return fetch(apiUrl + "API/foo").then(
function(response) {
return response.json();
});
}
Want to add global hear for my all fetch requests in react , i am stuck here please help me and thanks in advance.