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
1.2 KiB
1.2 KiB
Langkah 3: header permintaan
🌐 English · Dansk · Bahasa Melayu
Tugasan. Hantar header seperti pelayar bersama permintaan: sekurang-kurangnya User-Agent dan Accept-Language.
Apa yang dibina. DEFAULT_HEADERS dalam constants.py (tanpa Host dan X-Amzn-Trace-Id) dan RequestsPageFetcher, yang menghantarnya sebagai headers= kepada requests.get.
Apa yang pelayar hantar ke httpbin.org/headers, dan apa yang bot hantar (Host ditambah oleh requests):
Apa yang kita perolehi
- Permintaan membawa lebih daripada URL: pelayar, sistem dan bahasa dihantar dalam header.
- Dengan header yang betul, pelayan boleh menjawab dalam bahasa dan mata wang anda.
- Skrip tanpa header kelihatan seperti bot, dan banyak pelayan menyekat bot.
- Satu takrifan header yang baca sahaja, dan ujian yang menyemak apa yang dihantar.