| English | 释义 | 拼音 |
|---|---|---|
| server/ˈsɜːvə/ | 服务器 | fú wù qì |
| request/rɪˈkwest/ | 请求 | qǐng qiú |
| response/rɪˈspɒns/ | 响应 | xiǎng yìng |
| front end/frʌnt end/ | 前端 | qián duān |
| back end/bæk end/ | 后端 | hòu duān |
| API/ˌeɪ piː ˈaɪ/ | 应用程序接口 | yìng yòng chéng xù jiē kǒu |
| JSON/ˈdʒeɪsn/ | 数据交换格式 | shù jù jiāo huàn gé shì |
885 million documents behind a changed number, 2019
- In May 2019 the journalist Brian Krebs reported that the US title-insurance company First American had left about 885 million records — bank details, tax documents — reachable online. A customer's link contained a document number; changing the number showed other people's documents, because the server never checked who was asking.
- Every web app sends a request 请求 to a server 服务器 and receives a response 响应. The server must decide what each user may see.
What went wrong at First American in 2019?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Changing a number showed others' records.
Front end and back end
- The front end 前端 runs in the browser or app: pages, buttons, forms. The back end 后端 runs on the server: business rules, the database, security checks.
- Anything in the front end can be changed by the user, so security checks belong in the back end.
Match each job to front end or back end.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Security belongs on the server.
APIs
- An API 应用程序接口 is an agreed set of requests a program can make: for example
GET /api/courses/42asks for course 42. - The response has a status code — 200 OK, 401 not logged in, 403 not allowed, 404 not found — and usually a body.
Match each status code to its meaning.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Codes tell the front end what happened.
JSON
- Most web APIs send data as JSON 数据交换格式: names and values in braces, such as
{"id": 42, "title": "Databases", "places": 30}. - JSON is plain text, so both front end and back end in any language can read it.

同一个请求,不同的服务器与浏览器状态
有效的ID不等于有权访问。比较已确认的空列表、被拒绝的请求、查询失败和未收到响应,界面必须区分这些状态。
Which is valid JSON?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Names and values in braces, names in double quotes.
Worked example: one request, two checks
A student's app sends GET /api/grades/1057.
- Identity: is there a valid login token? No → 401.
- Permission: is student 1057 this user, or is the user their teacher? No → 403.
- Selection: return only the fields needed — module and grade, not the whole student record — as JSON with 200 OK.
A logged-in student asks for another student's grades. Which status code fits?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Logged in, but not allowed.
Requests take time
- A response can be slow or fail. The front end shows a loading state, then the data or a clear error message.
- Never assume the network always works.
A front end should show a loading state and handle errors.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Networks are slow or fail.
Hiding a button is not security. First American's links "looked" private; anyone could change the number. The server must check permission on every request.
Hiding a button in the front end stops users reaching the data.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
They can send the request directly.
The front end sends requests through an API; the back end checks identity and permission, then returns a response with a status code and JSON data — only what that user may see.
A timetable app requests GET /api/timetable/88. Describe the checks the server should make and what it returns.
Identity, permission, selection.