M. Kodirov

STAGE 01 / LESSON 03

HTTP requests and responses

HTTP defines how a client asks for a resource and how the server responds.

THE IDEA

Understand it.

A request includes a method, a target and headers; some requests also have a body. GET normally asks to read a resource, while POST is commonly used to submit data. The application defines what a particular endpoint does.

A response has a status and headers, and it can include a body. For example, 200 indicates a successful request, 404 indicates a missing resource, and 500 indicates a server error. Headers can describe the content type or caching behavior.

SEE IT IN CONTEXT

A simple HTTP exchange

GET /roadmap HTTP/1.1
Host: www.imkodirov.com

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8

<html>…</html>

This is illustrative HTTP/1.1 text; your browser may use HTTP/2 or HTTP/3 and show a different wire representation.

LEARN FROM REAL WEBSITES

See it in the real world.

These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.

GitHub

Documentation checked November 2026

Request a resource

GitHub's REST guide demonstrates requests to API endpoints and the responses a client receives.

  1. Client request
  2. HTTP method + URL
  3. GitHub API
  4. Status + response body

What to learn: The method, endpoint and response status are part of the HTTP contract; the API is one public part of GitHub.

Read the source: GitHub REST API guide

Spotify

Documentation checked November 2026

Call the Web API

Spotify documents HTTPS requests to its Web API and JSON responses for supported resources.

  1. Application
  2. HTTPS API request
  3. Spotify Web API
  4. JSON response

What to learn: Compare a request and its response with GitHub's: the same HTTP concepts apply even though the resources differ.

Read the source: Spotify Web API calls

TRY IT YOURSELF

Practice.

In the Network panel, reload this page and open its document request. Find the request method, status code, and Content-Type response header.

Show one possible answer

The document request will typically use GET. Its response status is shown separately from response headers; the Content-Type describes the returned representation.

GO DEEPER

Official references.