Advertisement
ABIX_Edukacja

wsgi_bytes

Apr 24th, 2019
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import wsgiserver
  2.  
  3. def application(environ, start_response):
  4.     body_str = 'Hello world!\n'
  5.     body_str_byte = bytes(body_str, 'utf-8')
  6.     status = '200 OK'
  7.     headers = [('Content-type', 'text/plain')]
  8.     start_response(status, headers)
  9.     return [body_byte]
  10.  
  11.  
  12. server = wsgiserver.WSGIServer(application)
  13. server.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement