Error in user YAML: (<unknown>): found a tab character that violate indentation while scanning a plain scalar at line 3 column 3
---
- oeasy Python 0520
- 这是 oeasy 系统化 Python 教程,从基础一步步讲,扎实、完整、不跳步。愿意花时间学,就能真正学会。
- 本教程同步发布在:
- 个人网站: `https://oeasy.org`
- 蓝桥云课: `https://www.lanqiao.cn/courses/3584`
- GitHub: `https://github.com/overmind1980/oeasy-python-tutorial`
- Gitee: `https://gitee.com/overmind1980/oeasypython`
---

sudo service nginx start
sudo service nginx status





- http
- hyper-text transmit protocol
- 超文本传输协议
- 是网络传输中使用的协议

-
GET
-
这是 从火狐浏览器
-
服务器 接到 请求之后
- 在网络中 浏览器
- 服务器 接到 请求(request) 之后

| 中文 |
英文 |
发送方 |
接收方 |
| 请求 |
request |
浏览器 |
服务器 |
| 响应 |
response |
服务器 |
浏览器 |

| 名称 |
含义 |
| Accept-Language |
接受的语言 |
| Host |
被请求的主机 |
| User-Agent |
发请求的浏览器 |
- nginx 服务器接收到了请求之后
- 就会进行处理
- 就像跑堂的 会处理客人要求一样
- 把客人需求 提给后台服务器
- 请求 有 请求头 的话

| 名称 |
含义 |
| Content—Length |
内容字节长度 |
| Date |
接收时间 |
| Server |
服务器 |
| Content—Type |
接收文件类型 |




- 在本次访问之前
- 浏览器 已经得到 这个html文件了
- 并且已经 缓存到了 本地硬盘
- 记录下了 这个html文件的 修改时间
- 这次 发请求的时候
- 把这个 html 上次的修改时间
- 作为 请求头 发到服务器
- 服务器
- 接收到 请求
- 发现 上次的访问之后 网页
没有修改
- 直接 返回304 告诉浏览器
- 除此304之外


- 404具体是什么意思?
- 点击状态码后面那个小问号
- 如果没有网的话就把地址复制粘贴出来



firefox http://localhost/oeasy.html &

- 火狐浏览器 的 规则
- 各种浏览器 在这方面 有共识

- HTTP
Hyper-Text Tranfer Protocol
- 超文本传输协议


- rfc1945
- 就是 Request for Comments: 2616
- rfc 是 征求(request)意见(comments)的稿子
- 谁在征求 意见呢?
- rfc1945 是
- ietf中的
- 因特网(internet) 协会(society) 提出的
- 和所有使用 互联网的用户 征求意见

- 这里 定义了 http协议的 最初的样子
- 从rfc1945 开始 就有 404 了
- rfc1945之前连404都没有
- 有了404(失败)
firefox http://localhost/50x.html &


| 状态码 |
状态 |
| 200 |
Ok |
| 304 |
Not modified |
| 404 |
Not found |
| 中文 |
英文 |
发送方 |
接收方 |
| 请求 |
request |
浏览器 |
服务器 |
| 响应 |
response |
服务器 |
浏览器 |

- 本文来自 oeasy Python 系统教程。
- 想完整、扎实学 Python,
- 搜索 oeasy 即可。