Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Last active March 11, 2021 10:50
Show Gist options
  • Save yuvalif/68f0b730c4615d726fcd89867f7c5e19 to your computer and use it in GitHub Desktop.
Save yuvalif/68f0b730c4615d726fcd89867f7c5e19 to your computer and use it in GitHub Desktop.
# 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)
@yuvalif
Copy link
Author

yuvalif commented Mar 11, 2021

note that this is python2 only server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment