

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Communicating on the Web
incomplete
2: HTTP Requests and Responses
incomplete
3: HTTP Powers Websites
incomplete
4: HTTP URLs
incomplete
5: Using URLs in HTTP
incomplete
6: Requests and Responses Quiz
incomplete
7: JavaScript's Fetch API
incomplete
8: Web Clients
incomplete
9: Web Servers
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
const issueURL: string = 'https://api.boot.dev/v1/courses_rest_api/learn-http/issues'
const issues = await getData<Issue[]>(issueURL)
logIssues(issues)
async function getData<T>(url: string): Promise<T> {
const apiKey = generateKey()
const response = await fetch(url, {
method: 'GET',
mode: 'cors',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
}
})
return response.json()
}