An HTTP request opened up into its request line, its headers, the blank line and a JSON body, with a 200 OK answer returning.

HTTP with Python

No reviews yet

See HTTP for what it is: lines of text on a TCP connection. You will write a request by hand, read the reply byte by byte, build a small JSON API server with the standard library, add redirects, cookies, caching, and authentication yourself, and then use requests, httpx, and FastAPI knowing exactly what each one does for you.
You need Networks with Python first: TCP connections with timeouts, framed messages, servers that stop on purpose, and socket code tested with a fake connection. Python Fundamentals II is recommended, not required: some supplied files contain classes, which the lessons explain, and you never have to write one.
You work in the site's terminal and project editor, in a sandbox with no route to the public internet. No real website is contacted: your clients talk to one internal practice service and to loopback servers you write yourself. One project, a reading-list service and its client, grows from Chapter 4 to the capstone.

  • 13

    chapters

  • 72

    lessons

  • 41

    practice exercises

  • 15

    projects

Certificate when you finish Available inEnglishNederlandsDeutsch

Lessons are arranged in a recommended order, but you can open any lesson.

Chapter 1

HTTP Is Text on a Socket

Chapter 2

Write Requests by Hand

Chapter 3

The Standard Client and Status Classes

Chapter 4

Serve HTTP Yourself

Chapter 5

Request Bodies and a JSON API

Chapter 6

Redirects

Chapter 7

State and Identity

Chapter 8

Caching and Conditional Requests

Chapter 9

One Connection, Many Requests

Chapter 10

requests and httpx, Now That You Know

Chapter 11

What a Framework Does for You

Chapter 12

Capstone: The Reading List Service and Client

Chapter 13

Where to Go Next