mini-web frame -WSGI-mini-web server function integrated frame -web dynamic request (5.1.2)

@

1. Description

It is a protocol WSGI
WSGI below
Here Insert Picture Description
process browser requests a dynamic page follows

2. Code

Python WSGI in the key code to achieve the following
env interaction data is used
dealHeaders function is used to process the header information, i.e. body before returning to the header information processing

def application(env, dealHeaders):
    status = "200 OK"
    headers = [("Content-type", "text/html")]
    dealHeaders(status, headers)
    body = time.ctime()
    return body

About the Author

Personal blog site
personal GitHub address
individual public number:
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/simon-idea/p/11415832.html