mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
[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:
parent
d17b3746cf
commit
de33490586
1 changed files with 14 additions and 1 deletions
|
@ -2,13 +2,26 @@
|
|||
|
||||
import BaseHTTPServer
|
||||
|
||||
|
||||
class MyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
|
||||
def do_GET(self):
|
||||
self.send_response(200)
|
||||
self.send_header("Content-type", "text/plain")
|
||||
self.end_headers()
|
||||
self.wfile.write("It works!")
|
||||
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):
|
||||
return "1.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue