Rest API - Authentication and Authorization
Consider this code snippet for an API call:
fetch('https://api.example.com/data', {
headers: { 'Authorization': 'Bearer abc123' }
})
.then(response => response.json())
.then(data => console.log(data));
What is the main purpose of the 'Authorization' header here?