[ADD] Added the feature to return 0 content to the python http test server and added functionality for post requests

This commit is contained in:
Christian Struck 2014-10-22 16:05:06 -07:00
parent d17b3746cf
commit de33490586

View file

@ -2,12 +2,25 @@
import BaseHTTPServer
class MyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
if "/empty" in self.path:
self.wfile.write("")
else:
self.wfile.write("It works!")
def do_POST(self):
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
if "/empty" in self.path:
self.wfile.write("")
else:
self.wfile.write("It works!")
def version_string(self):