一,请求的本质
平时开发使用的 http 或 https 均属于应用层的协议,其本质都会调用 TCP 发送请求。
例如:你在 Python 中使用 requests 模块发送一个 http 请求,其底层就是使用 socket 模块 + TCP 实现发送的请求。
import requests
res = requests.get("http://wiki.mikecrm.com/index?ajax=1&page=2")
print(res.text)
如果基于底层的 socket 模块 + TCP 协议实现如下:
import socket
client = soc