def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return [b'<h1>Hello, web!</h1>']
return中的最前面的b代表的是什么,我取消之后,发现页面就接受不到这个返回值了
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return [b'<h1>Hello, web!</h1>']
return中的最前面的b代表的是什么,我取消之后,发现页面就接受不到这个返回值了
4 回答968 阅读
1 回答574 阅读
1 回答697 阅读
1 回答692 阅读
1 回答526 阅读
643 阅读
584 阅读
这样返回的是bytes类型的数据。
在网络传输中,一般都是转换为bytes类型。在Java中也有类似的概念,叫序列化。