]>
git.ipfire.org Git - ipfire.org.git/blob - www/web/http.py
2 # -*- coding: utf-8 -*-
4 code2msg
= { 200 : "OK",
5 302 : "Temporarily Moved",
7 500 : "Internal Server Error", }
10 def __init__(self
, code
, header
=None, type="text/html"):
13 print "Status: %s - %s" % (self
.code
, code2msg
[self
.code
],)
15 print "Pragma: no-cache"
17 print "Content-type: " + type
19 for (key
, value
,) in header
:
20 print "%s: %s" % (key
, value
,)
23 def execute(self
, content
=""):
27 class WebError(Exception):