Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Forked from fabiand/SimpleHTTPPutServer.py
Last active December 3, 2018 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuvalif/5c75a45090199664d618c302255d52d3 to your computer and use it in GitHub Desktop.
Save yuvalif/5c75a45090199664d618c302255d52d3 to your computer and use it in GitHub Desktop.
A simple HTTP Server supporting put
# python -m SimpleHTTPPutServer 8080
import SimpleHTTPServer
import BaseHTTPServer
class SputHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_PUT(self):
print self.command + " " + self.path
print self.headers
self.end_headers()
self.send_response(200, "")
if __name__ == '__main__':
SimpleHTTPServer.test(HandlerClass=SputHTTPRequestHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment