diff --git a/content/computer_sci/code_frame_learn/flask/MSGI.md b/content/computer_sci/code_frame_learn/flask/MSGI.md
index 7f422810d..43a2c2e39 100644
--- a/content/computer_sci/code_frame_learn/flask/MSGI.md
+++ b/content/computer_sci/code_frame_learn/flask/MSGI.md
@@ -55,8 +55,62 @@ def application(environ, start_response):
* environ:一个包含所有HTTP请求信息的`dict`对象;
* start_response:一个发送HTTP响应的函数。
+在`application()`函数中,调用:
+
+```python
+start_response('200 OK', [('Content-Type', 'text/html')])
+```
+
+就发送了HTTP响应的Header,注意Header只能发送一次,也就是只能调用一次`start_response()`函数。`start_response()`函数接收两个参数,一个是HTTP响应码,一个是一组`list`表示的HTTP Header,每个Header用一个包含两个`str`的`tuple`表示。
+
+通常情况下,都应该把`Content-Type`头发送给浏览器。其他很多常用的HTTP Header也应该发送。
+
+然后,函数的返回值`b'
Hello, web!
'`将作为HTTP响应的Body发送给浏览器。
+
+有了WSGI,我们关心的就是如何从`environ`这个`dict`对象拿到HTTP请求信息,然后构造HTML,通过`start_response()`发送Header,最后返回Body。
+
+整个`application()`函数本身没有涉及到任何解析HTTP的部分,也就是说,底层代码不需要我们自己编写,我们只负责在更高层次上考虑如何响应请求就可以了。
+
+这个`application()`函数怎么调用?如果我们自己调用,两个参数`environ`和`start_response`我们没法提供,返回的`bytes`也没法发给浏览器。
+
+**所以`application()`函数必须由WSGI服务器来调用**。有很多符合WSGI规范的服务器,我们可以挑选一个来用。但是现在,我们只想尽快测试一下我们编写的`application()`函数真的可以把HTML输出到浏览器,所以,要赶紧找一个最简单的WSGI服务器,把我们的Web应用程序跑起来。
+
+
+因此我们需要编写以下两个py程序:
+
+```python
+# hello.py
+
+def application(environ, start_response):
+ start_response('200 OK', [('Content-Type', 'text/html')])
+ return [b'Hello, web!
']
+```
+
+
+```python
+# server.py
+# 从wsgiref模块导入:
+from wsgiref.simple_server import make_server
+# 导入我们自己编写的application函数:
+from hello import application
+
+# 创建一个服务器,IP地址为空,端口是8000,处理函数是application:
+httpd = make_server('', 8000, application)
+print('Serving HTTP on port 8000...')
+# 开始监听HTTP请求:
+httpd.serve_forever()
+```
+
+其中,`hello.py`,是实现web应用程序的WSGI处理函数,`server.py`是负责启动WSGI服务器,加载`application()`函数
+
+# Conclusion
+
+无论多么复杂的Web应用程序,入口都是一个WSGI处理函数。HTTP请求的所有输入信息都可以通过`environ`获得,HTTP响应的输出都可以通过`start_response()`加上函数返回值作为Body。
+
+复杂的Web应用程序,光靠一个WSGI函数来处理还是太底层了,我们需要在WSGI之上再抽象出Web框架,进一步简化Web开发。
# Reference
* https://www.liaoxuefeng.com/wiki/1016959663602400/1017805733037760
+* https://www.liaoxuefeng.com/wiki/1016959663602400/1017806472608512
diff --git a/content/computer_sci/coding_knowledge/python/python_decorator.md b/content/computer_sci/coding_knowledge/python/python_decorator.md
new file mode 100644
index 000000000..3df40c4d1
--- /dev/null
+++ b/content/computer_sci/coding_knowledge/python/python_decorator.md
@@ -0,0 +1,52 @@
+---
+title: Decorators in Python
+tags:
+ - python
+ - coding-language
+date: 2024-03-09
+---
+在 **Python** 中,**@** 符号通常用作**装饰器**
+
+# abstract
+
+**装饰器**:**@** 符号用于修饰函数,为现有函数增加额外的功能。常见的用途包括插入日志、性能测试、事务处理等。装饰器的创建规则如下:
+ - 装饰器是一个函数。
+ - 装饰器接受被修饰函数作为参数。
+ - 装饰器返回一个新函数。
+ - 被修饰函数的签名保持不变。
+
+
+# example
+
+
+```python
+def uppercase_decorator(func):
+ def wrapper():
+ result = func().upper()
+ return result
+ return wrapper
+
+def emphasis_decorator(func):
+ def wrapper():
+ result = func()
+ return f"**{result}**"
+ return wrapper
+
+@uppercase_decorator
+@emphasis_decorator
+def greet():
+ return "hello"
+
+print(greet())
+```
+
+在上面的示例中,`@funcB` 修饰了函数 `funA`,使得 `funA` 在执行时会先调用 `funcB`,然后再执行自身的逻辑。
+
+
+# detail
+
+detail见下方的reference,还是蛮复杂的,要仔细看看
+
+# Reference
+
+* https://medium.com/citycoddee/python%E9%80%B2%E9%9A%8E%E6%8A%80%E5%B7%A7-3-%E7%A5%9E%E5%A5%87%E5%8F%88%E7%BE%8E%E5%A5%BD%E7%9A%84-decorator-%E5%97%B7%E5%97%9A-6559edc87bc0
\ No newline at end of file
diff --git a/content/computer_sci/web/http/attachments/Pasted image 20240308151842.png b/content/computer_sci/web/http/attachments/Pasted image 20240308151842.png
new file mode 100644
index 000000000..99223034b
Binary files /dev/null and b/content/computer_sci/web/http/attachments/Pasted image 20240308151842.png differ
diff --git a/content/computer_sci/web/http/attachments/Pasted image 20240308153643.png b/content/computer_sci/web/http/attachments/Pasted image 20240308153643.png
new file mode 100644
index 000000000..48605cce8
Binary files /dev/null and b/content/computer_sci/web/http/attachments/Pasted image 20240308153643.png differ
diff --git a/content/computer_sci/web/http/http_introduction.md b/content/computer_sci/web/http/http_introduction.md
index 367164990..8b1a732f1 100644
--- a/content/computer_sci/web/http/http_introduction.md
+++ b/content/computer_sci/web/http/http_introduction.md
@@ -15,6 +15,64 @@ HTTP是在网络上传输HTML的协议,用于浏览器和服务器的通信。
* `Network`显示浏览器和服务器的通信
* `Console` 用于debug的控制台,debug JS的运行
+
+
+
+可以看出来,浏览器发送给谷歌服务器`GET`的请求。
+
+`GET`表示一个读取请求,将从服务器获得网页数据,`/`表示URL的路径,URL总是以`/`开头,`/`就表示首页
+
+
+HTTP响应分为Header和Body两部分(Body是可选项),我们在`Network`中看到的Header最重要的几行如下:
+
+```
+200 OK
+```
+
+`200`表示一个成功的响应,后面的`OK`是说明。失败的响应有`404 Not Found`:网页不存在,`500 Internal Server Error`:服务器内部出错,等等。
+
+```
+Content-Type: text/html
+```
+
+`Content-Type`指示响应的内容,这里是`text/html`表示HTML网页。请注意,浏览器就是依靠`Content-Type`来判断响应的内容是网页还是图片,是视频还是音乐。浏览器并不靠URL来判断响应的内容,所以,即使URL是`http://example.com/abc.jpg`,它也不一定就是图片。
+
+HTTP响应的**Body就是HTML源码**
+
+HTTP请求的流程:
+
+> [!abstract]
+> 步骤1:浏览器首先向服务器发送HTTP请求,请求包括:
+>
+> 方法:`GET`还是`POST`,`GET`仅请求资源,`POST`会附带用户数据;
+>
+> 路径:`/full/url/path`;
+>
+> 域名:由Host头指定:`Host: www.sina.com.cn`
+>
+> 以及其他相关的Header;
+>
+> 如果是POST,那么请求还包括一个Body,包含用户数据。
+
+
+> [!abstract]
+> 步骤2:服务器向浏览器返回HTTP响应,响应包括:
+>
+> 响应代码:`200`表示成功,`3xx`表示重定向,`4xx`表示客户端发送的请求有错误,`5xx`表示服务器端处理时发生了错误;
+>
+> 响应类型:由`Content-Type`指定,例如:`Content-Type: text/html;charset=utf-8`表示响应类型是HTML文本,并且编码是`UTF-8`,`Content-Type: image/jpeg`表示响应类型是JPEG格式的图片;
+>
+> 以及其他相关的Header;
+>
+> 通常服务器的HTTP响应会携带内容,也就是有一个Body,包含响应的内容,网页的HTML源码就在Body中。
+
+> [!abstract]
+> 步骤3:如果浏览器还需要继续向服务器请求其他资源,比如图片,就再次发出HTTP请求,重复步骤1、2。
+
+
+Web采用的HTTP协议采用了非常简单的请求-响应模式,从而大大简化了开发。当我们编写一个页面时,我们只需要在HTTP响应中把HTML发送出去,不需要考虑如何附带图片、视频等,浏览器如果需要请求图片和视频,它会发送另一个HTTP请求,因此,一个HTTP请求只处理一个资源。
+
# Reference
+
* https://www.liaoxuefeng.com/wiki/1016959663602400/1017804782304672
\ No newline at end of file