这个 WSGI 驱动器会输出什么?

来自 WSGI 与 ASGI
Python 3.14 入门 2分钟

这个 WSGI 驱动器会输出什么?

Python
def application(environ, start_response):
    body = environ["PATH_INFO"].encode()
    start_response("200 OK", [("Content-Length", str(len(body)))])
    return [body]

captured = []

def start_response(status, headers):
    captured.append(status)

result = application({"PATH_INFO": "/health"}, start_response)
print(captured[0], b"".join(result).decode())
在试验场中打开
报告错误