说明:转载自https://blog.youkuaiyun.com/zhangmingbao2016/article/details/79615121
原因:测试用例对于python2.x 和 python3.x的写法不同。
python2.x请用一下用例测试:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
python3.x请用一下用例测试:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World"]
本文提供了Python2.x和Python3.x环境下WSGI应用的基本示例,展示了如何使用不同的返回类型来响应HTTP请求。Python2.x示例使用字符串返回,而Python3.x则使用字节串列表。
9056

被折叠的 条评论
为什么被折叠?



