Problem Statement
How can custom headers be added to a Fetch API request?
Explanation
Headers can be sent with fetch by including them in the options parameter.
This is useful for authentication tokens or content-type declarations.
Code Solution
SolutionRead Only
fetch(url, { headers: { 'Authorization': 'Bearer token' } });