文章目录
1 . Django请求生命周期
在web应用中request请求和response响应传递的都是字符串,其中:
request请求字符串里面是由请求头:Request Header 、分割符\r\n\r\n、请求体:Form Data三部分组成;
response响应字符串是由响应头:Response Header、分割符\r\n\r\n、响应体:Response。
请求和响应字符串都是以键值对的形式存在的。
request请求:以博客园页面为实例展示。
请求头:
Request URL: https://www.cnblogs.com/css/aggsite.min.css/?page=1
Request Method: GET
:authority: www.cnblogs.com
:method: GET
:path: /css/aggsite.min.css?v=2XtPAg0qfijOJVf0h91LxPsW6ueRCMY3G-LDqdM9c-c
:scheme: https
accept: text/css,*/*;q=0.1
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9,en;q=0.8
cache-control: no-cache
cookie: _ga=GA1.2.165424608.1560579174; __gads=ID=9894282a1398936d:T=1560608268:S=ALNI_MbS7e-a1VM0avpHflUaxejv99dSAQ; UM_distinctid=16c287398f919f-0d83a71fe950f3-37c143e-14400