We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Requests and Responses Quiz

  • A "client" is a computer making an HTTP request
  • A "server" is a computer responding to an HTTP request
  • A computer can be a client, a server, both, or neither. "Client" and "server" are just words we use to describe what computers are doing within a communication system.
  • Clients send requests and receive responses
  • Servers receive requests and send responses

Example Code

from typing import TypedDict


class Issue(TypedDict):
    title: str


async def main() -> None:
    issue_url = "https://api.boot.dev/v1/courses_rest_api/learn-http/issues"
    issues = await get_data(issue_url)

    log_issues(issues)


async def get_data(url: str) -> list[Issue]:
    api_key = generate_key()
    response = await pyfetch(
        url, headers={"X-API-Key": api_key, "Content-Type": "application/json"}
    )
    return await response.json()