wsgi 协议
前言
本来没打算这么早就学习 wsgi 的,因为想要学习python 是如何处理网络请求的绕不开 wsgi,所以只好先学习一下 wsgi。...response)
# 设置状态码与响应头
response('200 OK', [('Content-type', 'text/html')])
# 设置错误处理...处理图标请求
def ico():
with open('favicon.ico', 'rb') as f:
dt = f.read()
return dt
# 处理错误请求...response)
# 设置状态码与响应头
response('200 OK', [('Content-type', 'text/html')])
# 设置错误处理...UTF-8'>, 'wsgi.version': (1, 0), 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.multithread