Guest User

Untitled

a guest
Apr 26th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import web
  2. import httplib
  3.  
  4. urls = ("/(.+?)/?", "http_err")
  5. app = web.application(urls, globals())
  6.  
  7. class http_err:
  8. def GET(self, err_code):
  9. err_code = int(err_code.split("/")[0])
  10. response = "%d %s" % (err_code, httplib.responses[err_code])
  11. raise web.HTTPError(response)
  12.  
  13. if __name__ == "__main__":
  14. app.run()
Add Comment
Please, Sign In to add comment