Delivers MIL-006 tasks 1 to 4: the wiki pages in `docs/wiki/` in English, Danish and Bahasa Malaysia (Home plus one page per lecture step, each with its screenshot and a "what we gained" section, and a shared `_Sidebar.md`), laid out as `framework/process/wiki.md` says (English without suffix, `-da` and `-ms` for the others, a language line on every page). The README links to the wiki. Checked: the three languages have the same five pages; every page starts with the language line; code, commands and file names stay in English. There is no QC checklist for wiki pages, so there is no RC record. Publishing to the host's wiki (task 5, issue #31) follows after this merge. Task: MIL-006#1 Task: MIL-006#2 Task: MIL-006#3 Task: MIL-006#4
21 lines
1.2 KiB
Markdown
21 lines
1.2 KiB
Markdown
# Step 3: request headers
|
|
|
|
🌐 **English** · [Dansk](Step-3-Request-Headers-da) · [Bahasa Melayu](Step-3-Request-Headers-ms)
|
|
|
|
**Assignment.** Send browser-like headers with the request: at least `User-Agent` and `Accept-Language`.
|
|
|
|
**What we built.** `DEFAULT_HEADERS` in `constants.py` (without `Host` and `X-Amzn-Trace-Id`) and `RequestsPageFetcher`, which passes them as `headers=` to `requests.get`.
|
|
|
|
What a browser sends to httpbin.org/headers, and what the bot sends (`Host` is added by `requests`):
|
|
|
|

|
|
|
|

|
|
|
|
**What we gained**
|
|
|
|
- A request carries more than the URL: the browser, the system and the language travel in headers.
|
|
- With the right headers a server can answer in your language and currency.
|
|
- A script without headers looks like a bot, and many servers block bots.
|
|
- One read-only definition of the headers, and tests that check what is sent.
|