Last active
March 11, 2021 10:50
-
-
Save yuvalif/68f0b730c4615d726fcd89867f7c5e19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python -m SimpleHTTPPostServer 80 | |
import SimpleHTTPServer | |
import BaseHTTPServer | |
class SpostHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_POST(self): | |
print self.command + " " + self.path | |
print self.headers | |
print self.rfile.read(int(self.headers['Content-Length'])) | |
self.end_headers() | |
self.send_response(100, "") | |
if __name__ == '__main__': | |
SimpleHTTPServer.test(HandlerClass=SpostHTTPRequestHandler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note that this is python2 only server