PiClock project
This commit is contained in:
9
web_tools.py
Normal file
9
web_tools.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def result_ok(cl, response = None, content_type = "text/plain"):
|
||||
cl.send('HTTP/1.0 200 OK\r\nContent-type: ' + content_type + '\r\n\r\n')
|
||||
cl.send(response if response is not None else "Ok")
|
||||
cl.close()
|
||||
|
||||
def result_notfound(cl, response = None):
|
||||
cl.send('HTTP/1.0 404 NotFound\r\nContent-type: text/plain\r\n\r\n')
|
||||
cl.send(response if response is not None else "Not Found")
|
||||
cl.close()
|
||||
Reference in New Issue
Block a user